This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes How to avoid session creation on display of Login page ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to avoid session creation on display of Login page ?" Watch "How to avoid session creation on display of Login page ?" New topic
Author

How to avoid session creation on display of Login page ?

reethu shivanna
Greenhorn

Joined: Sep 09, 2012
Posts: 3
Hi ,

I have developed a login page in struts 1.3 ,onclick of Login ,action class is invoked &where we check for valid user ,if user is valid ,session has to be created ,but on display of Login.jsp page session is getting created automatically even before checking whether user is authenticated or not.

Please help me solve this.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Why would you not want to create a session? In general it's not the presence/lack of session that indicates login, but rather a valid user/etc. object in the session.

To answer your specific question, prevent session creation in the JSP with:
In general, you don't want to access a JSP page directly in an MVC app, rather go through an action. IIRC the default request processor will create a session for you, providing another reason to re-think your approach.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to avoid session creation on display of Login page ?
 
Similar Threads
How to create n-second delay in .jsp ?
Login/logout Problem
session keeps timing out
Log Out Problems
Handling Exceptions