• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web.xml in distributed env.

 
saurabh.u saraswat
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the distributed environment, where do we place the web.xml file(in which server, say for eg. if my appln is distributed among 3 servers)?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Since the application must run on all servers, the web.xml file needs to present on all of them.
 
saurabh.u saraswat
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks...
That means: the same web.xml is present in all the servers? and it will contain all the servlets from different servers?

Now, we know there is one instance of particular servlet per JVM!

Question: if i my appln is distributed on 3 servers and I have 5 servlets on each...then the JVMs will have instances for which servlets ...
(a.)5 servlets which are on the server
(b.)15 servlets?
 
saurabh.u saraswat
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think it will contain 5 instances only..
 
upul indrajith
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use same web.xml file in the all three location means that you have to deploy all 15 servlet per server. It means the JVM will have 15 instance per server.

So i think its useless. so i think its better to write the web.xml file more specifically then you will have three different web.xml files and they will deploy required servelets only.

If i m wrong someone please correct me
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by upul indrajith:
If you use same web.xml file in the all three location means that you have to deploy all 15 servlet per server. It means the JVM will have 15 instance per server.

So i think its useless. so i think its better to write the web.xml file more specifically then you will have three different web.xml files and they will deploy required servelets only.

If i m wrong someone please correct me


Yes, I think you're confused about what is happening here. In a distributed environment all servers are set up exactly the same way. This ensures that it doesn't matter which server handles a request. So the web.xml files will be exactly the same on all servers, and each one will list 5 servlets. That also means in each JVM will be 5 servlets.
 
Vilas Lawande
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't got it.
Is there diff JVM for all servlelet?

Please give me detail about JVM in distributed & standalone enviroument?
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vilas Lawande:
Is there diff JVM for all servlelet?


I'm not sure I fully understand your question, but there is one JVM for each server; so if there are 3 servers, then there are 3 JVMs.
 
Saurabh Saraswat
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:


Yes, I think you're confused about what is happening here. In a distributed environment all servers are set up exactly the same way. This ensures that it doesn't matter which server handles a request. So the web.xml files will be exactly the same on all servers, and each one will list 5 servlets. That also means in each JVM will be 5 servlets.




You are correct here....it means:
- each server will have same web.xml (DD)
- each JVM will have instances of only those servlets which are deployed in that server.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by saurabh.u saraswat:
In the distributed environment, where do we place the web.xml file(in which server, say for eg. if my appln is distributed among 3 servers)?


Hi,

It is not clear from your question that if you want to distribute your application is three different servers, like some parts are running on each server. In this case the web.xml is different and deployed per server as per the serve lets you deployed on that server.

If you are talking about the clustering like distributed environments, typically one container is spread across different JVMs and there is one instance of each servlet per JVM. You deploy, the application only at main server and the container take care to make instances of servlets, handling of session migration, application context etc. to distribute among JVMs.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic