M
marco
A strange problem, I think...
I have a basic HTML form sending username and password to a servlet.
This servlet uses an external class to set up a DB connection, using
the username and the password to get the login access.
The HttpSession initialized on the first jsp is passed to the external
class such as a parameter in the constructor.
The external class istance (i.e., conn) execute the query to the DB,
and then returns to the servlet all the information.
As the results arrive to the servlet, the servlet itself sets up the
session attributes.
For example:
s.setAttribute("userId", conn.rs.getString("ID"));
My question is:
Why the command: s.getAttribute("userId") returns NULL?
Thank you.
I have a basic HTML form sending username and password to a servlet.
This servlet uses an external class to set up a DB connection, using
the username and the password to get the login access.
The HttpSession initialized on the first jsp is passed to the external
class such as a parameter in the constructor.
The external class istance (i.e., conn) execute the query to the DB,
and then returns to the servlet all the information.
As the results arrive to the servlet, the servlet itself sets up the
session attributes.
For example:
s.setAttribute("userId", conn.rs.getString("ID"));
My question is:
Why the command: s.getAttribute("userId") returns NULL?
Thank you.