This week's book giveaway is in the Android forum.
We're giving away four copies of Learning Java by Building Android Games and have Jean-Marcel Belmont on-line!
See this thread for details.
Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

request.getSession()  RSS feed

 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the diffrence between
request.getSession(true) and request.getSession(false);
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getSession(true) will make a new session when no session existed. but getSession() do nothing.
 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<B>getSession(true) will make a new session when no session existed. but getSession() do nothing. </B>
But always there will have a session......So what is the use of giving true???
 
Ranch Hand
Posts: 8934
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

But always there will have a session......So what is the use of giving true???


If the previous session has timed out it returns a new. If there is no previous one then it returns a ne w one too.
What do you mean that there will be a session always.
 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean whenever yhe user login there will have a session automaticall created by container???.....am I right???
 
Pradeep bhatt
Ranch Hand
Posts: 8934
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Mathews P Srampikal:
I mean whenever yhe user login there will have a session automaticall created by container???.....am I right???


No..unless the first page displayed is a JSP..jsps create session by default.
 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that means we have to call true always in the first page.is it??
 
Pradeep bhatt
Ranch Hand
Posts: 8934
Firefox Browser Java Spring
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!