tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bodycombe, Andrew" <andrew.bodyco...@siemens.com>
Subject RE: Reg HTTP status 404 on Tomcat 5.0.16
Date Tue, 03 Feb 2004 14:09:57 GMT
You have mapped your servlet to the /sampleapp URL, so to access your
servlet, you need to use the following URL:

http://localhost:8080/sampleapp/sampleapp

I suggest changing your servlet-mapping as follows:

<servlet-mapping>
 <servlet-name>HelloServlet</servlet-name>
 <url-pattern>/HelloServlet</url-pattern>
</servlet-mapping>

Then, you can use the http://localhost:8080/sampleapp/HelloServlet URL

-----Original Message-----
From: Avinash Sridhar [mailto:smartnash78@rediffmail.com] 
Sent: 03 February 2004 14:03
To: tomcat-user@jakarta.apache.org
Subject: Reg HTTP status 404 on Tomcat 5.0.16


I have my "sampleapp" folder into which a small trial of HelloServlet needs
to be tested.

The directory structure of sampleapp is as follows,

e:\sampleapp\WEB-INF\classes\
             WEB-INF\lib
             WEB-INF\sourcefiles
             WEB-INF\web.xml
The "classes" directory has got 
classes\package1\structure

The <Context> </Context> tag in server.xml has been added like this.

/************************ server.xml ***************************/

<Context path="/sampleapp" docBase="e:\sampleapp" debug="0"
reloadable="true"> </Context>

/************************ server.xml ************/

/****************** web.xml *******************/
<?xml version="1.0" encoding="ISO-8859-1"?>

<!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>
  <display-name>Servlet 2.4 Examples</display-name>
  <description> Servlet 2.4 Examples </description>

<!-- Servlet mapping start --> 
<!-- Define servlets. i.e. bind a servlet name to a class -->

<servlet>
 <servlet-name>HelloServlet</servlet-name>
 <servlet-class>package1.structure.HelloServlet</servlet-class>
</servlet>

<!-- bind a servlet name to a URL (pattern) -->
<servlet-mapping>
 <servlet-name>HelloServlet</servlet-name>
 <url-pattern>/sampleapp</url-pattern>
</servlet-mapping>

<!-- Servlet mapping end -->

</web-app>

/****************** web.xml *******************/



The error I am getting in the browser is this 

HTTP Status 404 - /sampleapp/HelloServlet

-----------------------------------------------------------------------
type Status report

message /sampleapp/HelloServlet

description The requested resource (/sampleapp/HelloServlet) is not
available.


This is the url I gave 

http://localhost:8080/sampleapp/HelloServlet


Kindly let me know what could be wrong in the above configuration.

Any help would be appreciated.

Thanks 
AS

                    

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message