File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
Login/logout Problem
How to create n-second delay in .jsp ?
Log Out Problems
session keeps timing out
Handling Exceptions