Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to avoid session creation on display of Login page ?

 
reethu shivanna
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic