Meaningless Drivel is fun!*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "basics of web.xml" Watch "basics of web.xml" New topic
Author

basics of web.xml

Pratibha Malhotra
Ranch Hand

Joined: Dec 21, 2003
Posts: 199
I am using a servlet with name HelloWorldServlet by using
http://localhost:8080/chapter01/servlet/HelloWorldServlet
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
http://localhost:8080/chapter01/HelloWorldServlet


~ 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
Author
Ranch Hand

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

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

Malhar Barai
SOA & Java Book
Anonymous
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
Olli
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5

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.
Bill
 
Consider Paul's rocket mass heater.
 
subject: basics of web.xml
 
Similar Threads
Running Servlet
Beginners ques- servlet not deploying
Servlet beginners question
Help. Tomcat installed - can't see servlet
Can not run a servlet class