• 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: 3890
12
  • 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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!