now when user goes on another page it shows welcome null Where am I going wrong. please help me :(
I'm trying to keep the user logged in but once the user logs in it displays the message welcome, username. but when user clicks on change password link the it shows welcome null it means shows the user logged out kinda! please suggest what is happening?
For the first page, where the user enters username -> request.getParameter() will work because parameters have been set! . But it wont work for any subsequent request because there is no parameter set, so how can it fetch?
To make it work, you can
1. Get the parameters in the String-> request.getParameter("parameter");
2. Store the parameters as attributes for session - > hs.setAttribute("attribute", variable);
3. Make sure your session remains alive for the required interval -> hs.setMaxInactiveInterval(seconds); . Atleast 1 minute (depends on application)
4. For any other page to get the username, hs.getAttribute("name of attribute");