aspose file tools*
The moose likes JSP and the fly likes Not able to manage JSP sesisons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Not able to manage JSP sesisons" Watch "Not able to manage JSP sesisons" New topic
Author

Not able to manage JSP sesisons

Pranit Sonawane
Ranch Hand

Joined: Jul 29, 2011
Posts: 165

Hi all 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? here's the code!!

userhome.jsp



AdminLoginCredentials.jsp



now when user goes on another page it shows welcome null Where am I going wrong. please help me :(
Gaurav Wadhwani
Ranch Hand

Joined: Sep 21, 2010
Posts: 68
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");
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Not able to manage JSP sesisons