Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When web.xml is loaded?

 
Mauricio Lopes
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When Tomcat loads the web.xml file? Only when the first request is made?
What is the container lifecycle, since its start?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will be read at startup. If you make your application reloadable, it will also be read when changes are made to it.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More accurately, the Tomcat deployer reads, digests, and applies web.xml to build Tomcat-internal app support objects. The application itself doesn't access web.xml, but it's one of 2 deployment descriptors used when a webapp is deployed. Web.xml is the container-independent deployment spec. The other deployment descriptor is container-specific, and in the case of Tomcat, it's the Context definition supplied or synthesized when a webapp is deployed.

Under normal circumstances, all eligible webapps are deployed at server startup and when the webapp WAR or Context definition is changed. Redeploying on a change is optional, but enabled by default. Tomcat scans the webapps at intervals and redeploys eligible webapps, so the redeployment isn't quite instantaneous, but it's a fairly short interval by default.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic