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 is servlet container?

902


Why is Servlet so popular?

809


How is an application exception handling is done using a servlet?

784


Explain is servlet mapping?

793


What is Client-Server Computing?

2134


Can we refresh servlet in client and server side automatically?

825


What are the functions of an intercepting filter?

744


Explain the different ways for servlet authentication?

814


Where do you define dispatcherservlet?

776


What is servlet lazy loading?

924


How do you invoke a servelt?

867


Why is httpservlet declared abstract?

830


How can we upload the file to the server using servlet?

784


What is the directory structure of web application?

756


What is the disadvantage of cookies?

805