File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes basics of web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "basics of web.xml" Watch "basics of web.xml" New topic

basics of web.xml

Pratibha Malhotra
Ranch Hand

Joined: Dec 21, 2003
Posts: 199
I am using a servlet with name HelloWorldServlet by using
where servlet is a virtual directory which don't exist.
what changes do i have to make to access this servlet without using /servlet
ie by using

~ Pratibha Malhotra<br /> <br />Sun Certified Java Programmer<br />SCEA 1.4 (In Progress)<br />~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />"Many of life's failures are people who did not realize how close they were to success when they gave up!!"
Malhar Barai
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
Make the following changes in the web.xml file that exists in WEB-INF folder:

[ March 31, 2004: Message edited by: Malhar Barai ]

Malhar Barai
SOA & Java Book
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I think there is a small mistake in the above example. Shouldn't it be:

The chapter01 is defined by the web application
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13025

In order to avoid various problems, all Java classes used in servlets or JSP should be put in a package. Remember that the location under WEB-INF\classes must reflect the package naming.
subject: basics of web.xml
It's not a secret anymore!