• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Who creates the HttpSession , User or WebLogic

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,

I have the code in my front controller like

HttpSession session = request.getSession(false)

here giving session != null.

From this i understood that WebLogic creates the HttpSession for User when sends first request from the browser.

Then what is the use of HttpSession session = request.getSession(true).

please clarify my doubt.



thanks in advance
Murali
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


request.getSession(true);



will get you a new session if its not existing already.
 
murali kankanala
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I Know the answer request.getSession(true) creates a new session if not already exists.

What i am expecting is request.getSession(false) is fulfilling my requirement , i never where used the request.getSession(true) in my code then who is creating the Session
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There might be some place where you are creating the session.Do you have any context listener installed for your web application ?

By default sessions are not created , untill you ask the container to create one for you.
reply
    Bookmark Topic Watch Topic
  • New Topic