Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Management Mechanism

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • 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 Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds to me more logical for these methods to be in the HttpSession interface!
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • 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 ]
 
Sergio Tridente
Ranch Hand
Posts: 329
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • 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 Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sergio,

Your explanation now seems more logical to me. Thanks for the clarification!
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic