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 tld in jsp?
What is use of scriptlet tags in jsp?
What is session object in jsp?
Explain the various scope values for tag.
How do I mix jsp and ssi #include?
difference betwwn 16 bit and 32 bit
What is jsp-config in deployment descriptor?
Explain the uses of
How does el search for an attribute?
Is there a way to reference the "this" variable within a jsp page?
Explain implicit objects in jsp?
How we can include the result of another page in jsp?
Define JSP Scriptlet.
Can we use the exception implicit object in any jsp page?
Why is it that JComponent have add() and remove() methods but Component doesn’t?