> I'm stumped.  I have the following directory structure/files:
> 
> c:/tomcat/webapps/ServletTest/WEB-INF/web.xml
> c:/tomcat/webapps/ServletTest/WEB-INF/classes/ServletTest.class
> 
> I added the following to my server.xml file:
> 
> <Context path="/ServletTest"
>          docBase="webapps/ServletTest"
>          crossContext="false"
>          debug="0"
>          reloadable="true" >
> </Context>
> 
> And my web.xml contains:
> 
> <web-app>
>   <servlet>
>     <servlet-name>ServletTest</servlet-name>
>     <servlet-class>ServletTest</servlet-class>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>ServletTest</servlet-name>
>     <url-pattern>/ServletTest</url-pattern>
>   </servlet-mapping>
> </web-app>
> 
> If I attempt to open http://localhost/ServletTest, I get HTTP 
> 404, file not
> found.
> If I attempt to open http://localhost:8080/ServletTest, I get the page
> cannot be displayed.

To get your desired results you can either change your server.xml to be
<Context path="/"
          docBase="webapps/ServletTest"
          crossContext="false"
          debug="0"
          reloadable="true" >
</Context>
where the important thing to note is the path, or you can change the request
to be http://localhost:8080/ServletTest/ServletTest.


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com

Reply via email to