aspose file tools*
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
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: 60053
    
  65

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: 60053
    
  65

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Complete web.xml file in XML format
 
Similar Threads
web.xml
redirect if error 404 comes
passing a matrix
XML Doubt
taglib URI question