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
What are the main tags in jsp?
what is the difference between jsp and servlets ?
How to connect jsp and java file?
Why is jsp used?
What is an expression language?
How many tags are provided in jstl?
How does a jsp work?
What is jsp api?
How do I mix jsp and ssi #include?
How do I run a jsp file in linux?
How jsp is compiled?
What is the difference in using request.getrequestdispatcher() and context.getrequestdispatcher()?
What is jspinit method?
Mention the implicit objects in a jsp.
Differentiate between response.sendredirect(url) and