• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt regarding session management

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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....
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic