• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Session Management Mechanism

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

Why is that we can get the information about which session management mechanism in employed from the request object as opposed to getting it from the session object???
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds to me more logical for these methods to be in the HttpSession interface!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why should a session care how the container manages it? It's not being done on a session-by-session basis, it's being done the same way for all sessions. So it makes sense that the method that gives this information is not implemented in each session.
[ April 25, 2007: Message edited by: Ulf Dittmer ]
 
Ranch Hand
Posts: 329
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why more logical?

Where do you get the session from? HttpServletRequest.getSession()
How do you get the query string? HttpServletRequest.getQueryString()
How about all other URL/URI methods? HttpServletRequest.getRequestURL(), HttpServletRequest.getRequestURI(), etc.
How do you get cookies? HttpServletRequest.get Cookies()

Don't forget the method you are talking about are named: isRequestedSessionIdFromURL(), isRequestedSessionIdFromCookie().

Everything comes from the response. It looks logical to see those methods there, don't they?
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sergio,

Your explanation now seems more logical to me. Thanks for the clarification!
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the exam test us in knowing the location of such methods like above? Do we have to be 100% strong with the API's?
 
reply
    Bookmark Topic Watch Topic
  • New Topic