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 do you prevent the creation of a session in a jsp page and why? What is the difference between include directive & jsp:include action?
How many jsp implicit objects are there?
What do you know about jsp expression language (jsp expression language – el)?
Which tag is used for error handling in jsp pages?
How does a jsp function?
Why is it not recommended to use script elements in jsp?
What are directives? What are the different types of directives available in jsp?
Explain the advantages in jsp?
Can I use javascript on jsp page?
What is difference between jspwriter and servlet printwriter?
What is tld in jsp?
What is jsp in javascript?
How can we disable el?
What does jsp mean in text?
What is a hidden comment in jsp?