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
Can I run jsp on xampp?
What are the two types of comments supported by jsp?
Explain the difference between jspwriter and servlet printwriter in jsp?
How do we print “
creates a new line in html” in jsp?
What are the different scopes an object can have in a jsp page?
How do I run a jsp file in linux?
what are the tools used in your project , How to ask the answer this question
Why jsp and servlets are used?
What are the jsp standard actions?
Differentiate between jsp scriptlet tag and declaration tag.
Is jsp a front end?
How can I override the jspdestroy() method within a jsp page?
How can I implement a thread-safe jsp page? What are the advantages and disadvantages of using it?
Why is _jspservice () method starting with an '_'?
What do you mean by jstl?