• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP session  RSS feed

 
Anirban dutta
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In all my Jsp pages I have said session to be false, but still it is getting the sesssion object, I am not able to figure out, from where. Please help me in getting a solution.
 
krishnamurthy bomma
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you setting session is false it doesn't mean that you should not get the session.It means that if the session is not created don't return other return the previously created session.But it wont create the new session for you.i think any one of ur jsp page session is not set false using the directive.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually... the spec says:

session indicates that the page requires participation in an (http) session.
If "true" then the implicit script language variable named "session" of type javax.servlet.http.HttpSession reference the current/new session for the page.
If "false" then the page does not participate in a session; the "session" implicit variable is unavailable, and any reference to it within the body of the JSP page is illegal and shall result in a fatal translation error.
Default is "true".

So... even if some random page has session="true" that should not cause other pages whose session is defined to "false" to have a "session" variable.
Two possible causes:
1- the app server you're using does not meet spec
2- you're defining the session attribute incorrectly. Can you post a sample JSP page where you're seeing this behavior?
[ March 29, 2003: Message edited by: Jessica Sant ]
 
puma Linus
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When u define session false it means that " the application itself will not create a new session if it already not exist " rather it can only use the existing session.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!