Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Request  RSS feed

 
Vallabhaneni Suresh Kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between getSession(boolean true) and getSession() methods? How we will decide which method should be used?
 
Flemming Mertz
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
The getSession() method is just short for getSession(true). So the only reason for using the version that takes a parameter, is to specify that you do not want a session to be created, if one does not exist already.
Regards,
Flemming Mertz
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!