• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Confusion regarding Session = False

 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Enthuware Software Support
Posts: 4892
60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic