Which is better approach among four(HttpSession,cookie,URL
Rewriting, Hidden Fields) Session Tracking technic's ? Why ?
Answer Posted / sridhar
Best Approaches are HttpSession and URL Rewriting.....
in HttpSession when client sends the request to the server first time session object will be created.
HttpSession ses=Request.getSession(true);//if session is not created a new session will be created and JsessionId is sent to the client.if session is already created existed Jsession Id send to the client.
HttpSession ses=Request.getSession(false);//if session is already created the Jsessionid will send to the client
if not it will not create Session object.
If browser doesn't support cookies the appln will not work properly.
So to avoid this problem We can use UrlRewriting........
Is This Answer Correct ? | 17 Yes | 3 No |
Post New Answer View All Answers
Explain the role of dispatcherservlet and contextloaderlistener.
Which event is fired at the time of session creation and destroy?
What is cgi?
What is difference between cookies and httpsession?
How to get the server information in a servlet?
What is the use of servlet wrapper classes?
What is the difference between CGI and Servlet?
How can you run a servlet program?
Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?
What do you mean by httpservlet and how it is different from the genericservlet?
What methods do you use in servlet - applet communication?
Difference between forward() method and sendredirect() method ?
What’s the difference between sendredirect and forward methods
What is meant by Servlet? What are the parameters of service method?
Whether thread can be used in servlets?