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 use of scripting elements in jsp is discouraged?
Mention the jstl core tags.
What are the different types of jsp tags?
Can you explain what is jsp page life cycle?
Is jsp server side scripting language?
Why do we need servlets and jsp?
What is asp and jsp?
difference betwwn 16 bit and 32 bit
How to delete a cookie in jsp?
What is jsp and why it is used?
Can Static method be Override?
What is jsp custom tag and what are it’s components?
What are the advantages of jsp over servlet?
Can a constructor be used in place of init() method to initialize a servlet?
What is jsp taglib?