This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is difference between server.xml and web.xml files?

 
mini mehta
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the significance of following files in Tomcat
1. server.xml
2. web.xml
 
vivek sivakumar
Ranch Hand
Posts: 187
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
well to make things simple , server.xml is for the server and web.xml is specific for application.
To brief up more, there could be only one server.xml for any given server but there can be 100s(though not reality!) of web.xml. A server hosts many number of applications so each application could have a significant web.xml of its own!
server.xml >>> could have general authentication procedures which are common for all applications which run under it.
web.xml >>> could have significant proceures defined only for that particular appliaation to which it belongs.fo eg: when ever a application is launched then WELCOME.html should be the starting page and this could vary from one application to another which can be accomplished by web.xml!!!
hope this helps!!
 
mini mehta
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can they both contain context information i,e <context> or its only server.xml.
BTW thanks for your help.
Mini
Originally posted by vivek sivakumar:
hi,
well to make things simple , server.xml is for the server and web.xml is specific for application.
To brief up more, there could be only one server.xml for any given server but there can be 100s(though not reality!) of web.xml. A server hosts many number of applications so each application could have a significant web.xml of its own!
server.xml >>> could have general authentication procedures which are common for all applications which run under it.
web.xml >>> could have significant proceures defined only for that particular appliaation to which it belongs.fo eg: when ever a application is launched then WELCOME.html should be the starting page and this could vary from one application to another which can be accomplished by web.xml!!!
hope this helps!!

 
Tim Holloway
Saloon Keeper
Pie
Posts: 17625
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Context is used by the tomcat server to map a URL and its virtual directories (among other serving-related functions) - it goes only in server.xml. The web.xml defines the structure and mapping of a specific web app independent of the local implementation of that app (URL &co). That keeps things portable so you can buy a web app off the shelf and not have to modify it internally to setup the high-level paths.
 
mini mehta
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim,
I appreciate the help. BTW do I need to declare every servlet I put in WEB-INF/classes in web.xml file. How about every JSP???

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic