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 / rajib
import javax.servelet.*;
public MyServelet extends HttpServelet{
public void doGet(HttpServeletRequest
req,HttpServeletResponse res)throws ServletException,IO
Exception{
res.setContentType("text/html");
PrintWriter out=res.getPrintWriter();
out.println("for trac session0");
HttpSession sess=req.getSession();
if(sess==null){
out.println(Old session not exist );
}else{
HttpSession session=request.getSession(true);
out.println("new Session Created.");
}}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Why is it that JComponent have add() and remove() methods but Component doesn’t?
Which tag should be used to pass information from jsp to include jsp?
What are the benefits of pagecontext implicit object?
Mention the various implicit objects used in the expression
How do I use a scriptlet to initialize a newly instantiated bean?
How can information from one JSP be passed to another JSP?
How can I prevent the output of my jsp or servlet pages from being cached by the browser?
What is the difference between jsp and php?
How to deactivate el usage on jsp?
What is a jsp file?
What is the
How do you delete the session data?
How can I handle jsp page errors?
What is the major difference between servletcontext and pagecontext?
What are the main tags in jsp?