This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have been reading Kathy Sierra Head First JSP/Servlets book and i am very happy to learn it the way the chapters are organized.
Recently i completed Conversational State chapter and tried having my hands on Sessions in Web in which i am stuck at 1 point, i created the following.
1. Login.jsp which would have a username and password. 2. LoginAction.java which would set the request parameter to session attribute and this LoginAction class would forward the request using RequestDispatcher to result.jsp. 3. result.jsp has a Greeting for the user registered saying "Welcome, " and it works like a dream.
Now my problem.
Result.jsp has a link to logout.jsp, Below is the code of result.jsp
and then logout.jsp has the following code :
What i was expecting was it would show "Welcome,Guest" because when i said session.invalidate, it made the session as null and on checker.jsp i am checking for session==null , however it showed Welcome null. I am not sure why session.invalidate() on Logout.jsp did not return null.
Can you all please help me.
Below is checker.jsp for reference.
Yogendra N Joshi. [ December 25, 2008: Message edited by: Yogendra Joshi ]
Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....