You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mark <ga...@sbcglobal.net> on 2003/01/16 18:36:01 UTC

Test servlet won't run - help?

Hi, 

I'm trying to run a simple Hello world servlet called myAppServlet.  I'm using Windows XP, Tomcat 4.1, and j2sdk 1.4.1.  The servlet WILL run when I put it in webapps/examples/WEB-INF/classes.  I can run it with the browser address, http://localhost:8080/examples/servlet/myAppServlet

However, the servlet will not run when I locate it in webapps/myApp/WEB-INF/classes.  When I try to run it with the browser address, http://localhost:8080/myApp/servlet/myAppServlet, I get the HTTP Status 404 error message.

I put the following web.xml file into the webapps/myApp/WEB-INF folder, which didn't have any effect:

<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
  <servlet>
    <servlet-name>myAppServlet</servlet-name>
    <servlet-class>myAppServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>myAppServlet</servlet-name>
    <url-pattern>/myAppServlet</url-pattern>
  </servlet-mapping>
</web-app>

I also stopped and started the computer to make sure that Tomcat was stopped and started again.


It seems as though Tomcat is not seeing my myApp application.  Any help would be greatly appreciated.  Thanks in advance.

Mark Steere
gardener@sbcglobal.net

Re: Test servlet won't run - help?

Posted by Mark <ga...@sbcglobal.net>.
Wow, thanks for the timely response.  That was right on the money.  I love
you guys.  Thanks Erik.

I will be unsubscribing now.  Thanks again.

Mark Steere
gardener@sbcglobal.net


> Try it from http://localhost:8080/myApp/myAppServlet
>
> That might work -- your URL-mapping doesn't say to look for
> servlet/myAppServlet.
>
>
> Erik
>
>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Test servlet won't run - help?

Posted by Erik Price <ep...@ptc.com>.
Try it from http://localhost:8080/myApp/myAppServlet

That might work -- your URL-mapping doesn't say to look for 
servlet/myAppServlet.


Erik




Mark wrote:
> Hi, 
> 
> I'm trying to run a simple Hello world servlet called myAppServlet.  I'm using Windows XP, Tomcat 4.1, and j2sdk 1.4.1.  The servlet WILL run when I put it in webapps/examples/WEB-INF/classes.  I can run it with the browser address, http://localhost:8080/examples/servlet/myAppServlet
> 
> However, the servlet will not run when I locate it in webapps/myApp/WEB-INF/classes.  When I try to run it with the browser address, http://localhost:8080/myApp/servlet/myAppServlet, I get the HTTP Status 404 error message.
> 
> I put the following web.xml file into the webapps/myApp/WEB-INF folder, which didn't have any effect:
> 
> <!DOCTYPE web-app
>   PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>   "http://java.sun.com/dtd/web-app_2_3.dtd">
> 
> <web-app>
>   <servlet>
>     <servlet-name>myAppServlet</servlet-name>
>     <servlet-class>myAppServlet</servlet-class>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>myAppServlet</servlet-name>
>     <url-pattern>/myAppServlet</url-pattern>
>   </servlet-mapping>
> </web-app>
> 
> I also stopped and started the computer to make sure that Tomcat was stopped and started again.
> 
> 
> It seems as though Tomcat is not seeing my myApp application.  Any help would be greatly appreciated.  Thanks in advance.
> 
> Mark Steere
> gardener@sbcglobal.net
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>