Q : In session created by server with client(browser) How
can server find that request coming is belong to new
session OR belong to session that is timeout.
Answer Posted / subhash
getSession() returns a session regardless of there's apre-
existing session.Since we always get back an HttpSession
instance back from the method,the only way to know if the
session is new is to ask the session itself:
HttpSession session=request.getsession();
if(Session.isNew())
{
out.println("A NEW SESSION");
}
else
{
out.println("WelCOme Back");
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is a expression?
Explain the difference between include directive and include action in jsp?
What is difference between java and jsp?
Is jsp technology extensible?
Which package does a jsp api consist of?
How do I use comments within a jsp page?
How clear chache and buffer of opera browser.
How can we stop errors on display in a jsp page?
What is a scriptlet?
Explain jsp technology?
What are the steps for creating custom tags in jsp?
Why does jcomponent have add() and remove() methods but the component does not?
What is scriptlet tag in jsp?
Is jsp static or dynamic?
Is jsp front end or backend?