File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes what is the work of web.xml in WEB-INF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "what is the work of web.xml in WEB-INF" Watch "what is the work of web.xml in WEB-INF" New topic

what is the work of web.xml in WEB-INF

Farrukhalee Khan

Joined: Nov 29, 2002
Posts: 1
when we prepare a website for hosting. The WEB-INF folder need web.xml. why? (that have differant packages/or pool connection packages)
and what would be contain of it. or where can i get it.
plz urgent....
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
The short answer is because the Servlet and JSP specs require it. However, you would probably get a more complete answer in the Servlet forum, which is where I'm moving this.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
The Java servlet and JSP APIs use web.xml to define just about everything in a web application environment. You have to create one youself. Go to and download the servlet and JSP APIs in PDF form. You can start here:
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
You don't really need to put anything in the web.xml other than the standard header lines and the < web-app > tags. But you do have to have a web.xml.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
I agree. Here's the link:
subject: what is the work of web.xml in WEB-INF
It's not a secret anymore!