• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is Deployment Descriptor always required?

 
Jack Davis
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is Deployment Descriptor always required when using servlets? Is a web.xml file always required also?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A web.xml deployment descriptor is not an absolute requirement because you can always use the "invoker". However, using the invoker gets you into all sorts of trouble and bizarre errors, as you can see by browsing the servlet related forums here. Nobody should undertake serious servlet development without understanding and using the web.xml capabilities, so you might as well just "bite the bullet" and learn it.
See some accumulated wisdom about the invoker here.
See Sun's documentation of the servlet APIhere.
Bill
 
Jack Davis
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. So even if the servlet you intend to use is totally behind the scenes, i.e extracting data from a mobile application to a table in the database, the web.xml file should still be involved?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So even if the servlet you intend to use is totally behind the scenes, i.e extracting data from a mobile application to a table in the database, the web.xml file should still be involved?

Certainly. For example you will be able to use init-params in the web.xml to set variables needed to do your database transaction.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic