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


Please Help Members By Posting Answers For Below Questions

What do you mean by httpservlet and how it is different from the genericservlet?

536


Can filter be used as request or response?

540


How do you invoke a Servlet? What is the difference between doPost method and doGet method?

644


Explain web container.

565


What is the GenericServlet class?

597






Who is responsible to create the object of servlet?

716


Explain Action Servlet?

621


What are the jobs performed by servlets?

581


Where do you define dispatcherservlet?

550


What is servlet initializer?

499


Explain load on start-up and its importance?

594


How can we refresh automatically when new data is entered into the database?

595


How many servlet objects are created?

561


Why jsp is better than servlet?

528


How do you invoke a servelt?

620