Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ServletContext and Session  RSS feed

 
Alex Qiu
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The spec of Servlet2.3 said :
ServletContext is in each JVM (maybe different)and Session is shared between JVM . (When in distributed system)
But in the Session Chapter 7 , it said :
HttpSession objects must be scoped at the application (or servlet context) level.
Problem is "(or servlet context)" .
If in servlet context level , that can be different in each JVM for the session when in distributed system .
Is there something wrong ?
I am really confused . what say you ?
Thank you in advance .
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you read further into the spec where it gets to the part about Sessions and a Distributed Environment (SRV.7.7.2)
"Within an application marked as distributable, all requests that are par of a session must be handled by one virtual machine at a time. The container must be able to handle all objects placed into instances of HttpSession class using setAttribute()"
It then goes on to list several restrictions that are put on the container... so the developer doesn't have to worry about it one little bit.
 
Alex Qiu
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes , I read it in the weekend .
Really thanks for your reply .
I should make questions after a complete reading .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!