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 is el in jsp?
What is custom tag library?
How do I open a jsp file?
What are the elements of jsp?
What is a page directive?
Can we use javascript with jsp pages?
How do we print “
creates a new line in html” in jsp?
Can a jsp page instantiate a serialized bean?
What are the implicit, internal el jsp objects and their differences from jsp objects?
What is the purpose of
Can a subsequent request be accessed with one’s servlet code, if a request attribute is already sent in his jsp?
Give an example of using your own tags.
What are the different types of directives available in jsp?
Differentiate between pagecontext.include and jsp:include?
How can I maintain session in JSP Page in the bases of user name and password: