Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Context

 
Vikrama Sanjeeva
Ranch Hand
Posts: 760
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Provided non distributable enviroment, is there one ServletContext for each webapp.Means if there are 3 webapp in a single web server then there will be 3 ServletContext objects are associated with each web appl.?
Bye.
Viki.
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One ServletContext - Object per WebApp.
AND: If you have the WebApp running on multiple maschines for loadbalancing/failover purposes:
One ServletContext Object per WebApp on every JVM.
If you have your webapp cool.war deployed on serverA, serverB, serverC there will be 3 ServletContext objects.
 
Jim Bertorelli
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to add: The servlet context for the default web-app is non-distributable. That means it exists on only one JVM and is not copied to other JVMs.
 
Vikrama Sanjeeva
Ranch Hand
Posts: 760
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Want to add some..

If you have your webapp cool.war deployed on serverA, serverB, serverC there will be 3 ServletContext objects.

If you have your webapp cool.war deployed on serverA, serverB, serverC there will be 3 ServletContext objects one on serverA,second on serverB and third on serverC
Is it right?
Bye.
Viki.
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. As I said and Jim clarified. There is a long discussion about this topic:
http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=18&t=000955
This multi-server stuff puts aditional complexities one is not that aware of if coding with tomcat on a pc. But I am sure that its an important part of j2ee.
[ February 27, 2002: Message edited by: Axel Janssen ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic