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
How can I declare methods within my jsp page?
What is jstl?
How can we avoid direct access of jsp pages from client browser?
What is jsp and its features?
What is jstl core tags?
How can I implement a thread-safe jsp page?
What is the requirement of a tag library?
Explain jsp and tell its uses?
What is scriptlet and what is expression?
How do I run a jsp file in linux?
What is use of scriptlet tags in jsp?
Why jsp is used in java?
What is application scope in jsp?
Is jsp better than servlet?
Java Server Page I can use a function in two ways:
Either I declare