• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet COntext

 
NDP Prasad
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why is servlet context is different for different JVMs?
Iam not getting this concept...pls paard me..Iam new to servlets.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no idea what you are asking. A servlet context exists for each web application, of which there can be many in one JVM. Where do multiple JVMs enter the picture? Can you point us to where you got this idea?
[ March 22, 2007: Message edited by: Ulf Dittmer ]
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JVMs can be different when our application is distributed and deployed accross different machines.

In this case the servlet contexts will be different because J2EE containers doesn't synchronize the contexts but they offer Session Synchronization accross diffrent machines.
 
NDP Prasad
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did't understand what is a servletContext, thats why i asked that stupid question? Thanks for your response.

I got something from this link http://www.oop-reserch.com/servlet_context.html
 
NDP Prasad
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this case the servlet contexts will be different because J2EE containers doesn't synchronize the contexts but they offer Session Synchronization accross diffrent machines



How do we communicate if our webapplications are distributed? I mean within the servlets?

I think for servletcontext, we can use Database to setAttribute..session also use the same concept to share accross jvms. Is there any other way?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by NDP Prasad:
How do we communicate if our webapplications are distributed? I mean within the servlets?

I think for servletcontext, we can use Database to setAttribute..session also use the same concept to share accross jvms. Is there any other way?


The servlet doesn't need to do anything for distributed web apps, and in particular, no database is required. As long as everything that is stored in the session is serializable, session replication will be made to work by the servlet container automatically.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic