Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where does the container look for the web.xml?

 
Sriram Sharma
Ranch Hand
Posts: 130
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where does the container look for web.xml?
I believe that the container looks for the web.xml when it starts up.
In my comp, there are lots of web.xml files.
Does the container read all the web.xml files?
Or does it read all the web.xml files inside all the WEB-INF folders present in the installed directory?

Regards,
Sriram
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi Sriram,

web.xml is most important part of any web application and is is only one per web application. So one application has only one web.xml file.
and that is why it is called deployment descriptor. when you are deploying your web application web.xml look inside WEB-INF folder and it is always be there.

so when you start your container the tomcat first look at web.xml inside WEB-INF/web.xml and according to what developer written inside web.xml container make initially configuration and set according to web application.

for more detail refer below url.

http://nishanpatel.wordpress.com/2009/04/30/deploymentdescriptor/

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat will look inside its webapps folder, as well as anywhere that you tell it to look via context declarations in server.xml, and in the host folder of the config folder.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic