Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

servlet registration in web.xml  RSS feed

 
san seny
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do we have to register all servlets in web.xml,when the same is not needed for JSPs?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The purpose of web.xml is to define the parts of a web application so clearly that it can be packaged up and installed on another web server with no problem. The first servlet APIs were pretty sloppy about this but Sun has progressively nailed things down as the API has been refined.
You can still turn on the "invoker" servlet to run servlets that are not defined in web.xml but I don't think it is a good idea.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!