session problem

G

gk

http://getahead.ltd.uk/dwr-demo/javadoc/uk/ltd/getahead/dwr/WebContext.html


we have these 2 definition in that page...


(1)

javax.servlet.http.HttpSession getSession()
Returns the current session associated with this request, or
if the request does not have a session, creates one.


(2)
javax.servlet.http.HttpSession getSession(boolean create)
Returns the current HttpSession associated with this request
or, if there is no current session and create is true, returns a new
session.



whats the difference between (1) and (2) ? i see, the different states
"current sesion"....can anybody explain this stuff to understand the
difference .

which one i should use ?
 
S

Sanjay

gk said:
http://getahead.ltd.uk/dwr-demo/javadoc/uk/ltd/getahead/dwr/WebContext.html


we have these 2 definition in that page...


(1)

javax.servlet.http.HttpSession getSession()
Returns the current session associated with this request, or
if the request does not have a session, creates one.


(2)
javax.servlet.http.HttpSession getSession(boolean create)
Returns the current HttpSession associated with this request
or, if there is no current session and create is true, returns a new
session.

All I can see is with this API, you have the handle not to create a
session if it doesnt exist.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
arinsharma
Top