Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confusion regarding Session = False

 
Poornima Sharma
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I have a confusion regarding Session=False.

In servlet when we use session=request.getSession(false); it does not create a new session, it returns the old session Object if it is present however

In JSP if we use session=false in page directive then we do not get the session object, hence how can we implement the above functionality.

Please guide.

Thanks
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3819
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Poornima Sharma wrote:Hi Friends,

I have a confusion regarding Session=False.

In servlet when we use session=request.getSession(false); it does not create a new session, it returns the old session Object if it is present however

In JSP if we use session=false in page directive then we do not get the session object, hence how can we implement the above functionality.

Please guide.

Thanks


You can use an EL expression such as ${not(requestScope.session)} to check if the session exists or not. This may not be the exact expression that you need but you should play around with it to suit your needs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic