aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Behavior of ServletContext VS Behavior of HttpSession Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Behavior of ServletContext VS Behavior of HttpSession" Watch "Behavior of ServletContext VS Behavior of HttpSession" New topic
Author

Behavior of ServletContext VS Behavior of HttpSession

Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 215
please tell me the difference between the "Behavior of ServletContext" VS "Behavior of HttpSession" in Distributed Environment?
nitin pai
Ranch Hand

Joined: May 30, 2006
Posts: 185
In a distributed environment,
Each JVM will have a separate ServletContext. So you cannot depend on the Conetext level attributes while sharing attribute information

But the Session object is shared between all the JVM's present in the environment. You can test this out by implementing the HttpSessionActivationListener on your attributes.

The attributes will be passivated and then activated when they move from one server to another but in this case your attributes must be serializable.



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Behavior of ServletContext VS Behavior of HttpSession