File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Doubt regarding session management Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Doubt regarding session management" Watch "Doubt regarding session management" New topic
Author

Doubt regarding session management

bala rimmalapudi
Greenhorn

Joined: Feb 11, 2011
Posts: 7
Hi All,
Can anyone tell me how the below code block works with two consecutive requests from same client. (I am not clear with session management where both cookies and URLRewriting is used for session management fall back approach):

public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException{

HttpSession session = request.getSession(); // Will it check both "Cookie" header and requestURL in the request
out.println("<html><body>");
out.println("<a href=\"" + response.encodeURL("/BeerTest.do")>");
out.println("</body></html>");

}

Thanks in advance....
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
Obviously, the servlet container knows how to parse both the URL and the headers to locate a session ID tag.

It also knows how to get parameters from either the URL or the request body - lots of thought has gone into making request handling.

Bill

Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt regarding session management
 
Similar Threads
About create a session!
Session Management
Need to split up servlet
how to set environment variables for running a servlet program?
how to redirect url to the login page?