difference between request.getSession(false) or
request.getSession() and request.getSession(true)

Answers were Sorted based on User's Feedback



difference between request.getSession(false) or request.getSession() and request.getSession(true)..

Answer / msreekanth2004

request.getSession(true) or request.getSession():
If session is present it returns that session. Otherwise
it'll create a new session and return that.

request.getSession(false):
If session is present it returns that session. Otherwise it
return "null"

Is This Answer Correct ?    45 Yes 2 No

difference between request.getSession(false) or request.getSession() and request.getSession(true)..

Answer / bhaskar

Your answer 100% right

Is This Answer Correct ?    13 Yes 1 No

Post New Answer

More Servlets Interview Questions

how this statement works..? public void service(HttpServletRequest request,HttpServletResponse response)

2 Answers   TCS,


How do you invoke a servelt?

1 Answers  


What are the various ways of session supervision in servlets?

1 Answers  


What is servlet in web technology?

1 Answers  


How we can get ip address of client in servlet?

1 Answers  


How do you design microservices?

1 Answers  


How to get the server information in a servlet?

1 Answers  


How to get the actual path of servlet in server?

1 Answers  


what is the difference b/w DispatchAction and LookUpDispatchAction?

1 Answers   Deloitte, iGate, Tech Mahindra,


what is OOAS

2 Answers   iGate,


How to rectify errors in java servlet while compilation?

1 Answers  


How can I share objects across different sessions?

2 Answers   Accenture,


Categories