This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes Complete web.xml file in XML format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Complete web.xml file in XML format" Watch "Complete web.xml file in XML format" New topic
Author

Complete web.xml file in XML format

Gary Engebretson
Greenhorn

Joined: Sep 23, 2006
Posts: 2
I have been looking for a COMPLETE example of a web.xml file. I have found snippets and narrative explantions but I would really like to have full blown example in XML format.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61082
    
  66

This seems more appropriate for the Servlets forum than JSP, so moved there.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61082
    
  66

Well, if by "complete" you mean "uses every conceivable setting" you are unlikely to achieve satisfaction.

If you want to see an example of a working web.xml from an actual deployed web application, I've included one below from one of my clients' application (with various names changed to protect confidentiality).

It employs a broad spectrum of settings: context params, listeners, filters and filter mappings, servlets and servlet mappings, error handling, resource referencing, and defines a JSP prelude.

Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The servlet spec goes through the entire thing as well.
Link in my signature.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
DTD of the web.xml can be of help in this case.


Rahul Bhattacharjee
LinkedIn - Blog
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Complete web.xml file in XML format