The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Heres what you need to do

Posted by Jay on November 07, 2001 at 8:36 AM

You have got the Context right. But have you registered the servlet in web.xml? If not, register this way:


Servlet-name is how you want to access the servlet and servlet-class is the actual class file name.

Note that thats this is what the servlet specification says.

You can not get rid of the entire "http://localhost:8080". You need to tell the browser which machine to make connection to right? So in your server.xml search for

<Connector className="org.apache.tomcat.service.PoolTcpConnector">
<Parameter name="handler"
<Parameter name="port"

and change 8081 (or what ever you have there) to 80.

This means you have to access your servlet using the URL "http://localhost:80/inquiry/servlet/myservletfilename". But as 80 is the default http port, you can just say:

Name your webserver and you could use that name instead of "localhost"



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us