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

How do you define a servlet?

523


What is the requirement of servlet config and servlet context implemented and how are they implemented?

539


What is the life-cycle of servlets?

632


What are the life cycle methods of the servlet?

578


What is servlet in web technology?

576






What are the difference between RMI and Servlets?

1049


Write the code to get the server information in servlet.

570


Difference between forward() method and sendredirect() method ?

582


What are the annotations used in servlet 3?

574


explain the advantages of servlet life cycle?

555


Is servlet a server side scripting language?

553


Does servlet have main method?

687


What is called Session Tracking?

598


Which java application server is the best?

545


Is servlet thread safe?

519