tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Huang <Denn...@datacom.com.au>
Subject RE: Apache and Tomcat running, cant hit servlets in new directory ...
Date Mon, 04 Sep 2000 02:56:16 GMT
The following email is not sent by me. I don't know why this happens.

Dennis Huang

-----Original Message-----
From: DennisH@datacom.com.au [mailto:DennisH@datacom.com.au]
Sent: Saturday, September 02, 2000 6:07 AM
To: tomcat-user@jakarta.apache.org
Subject: Apache and Tomcat running, cant hit servlets in new
directory...



I have Apache and Tomcat up and running.
I wish to create servlets and jsp pages in a place other then
/webapps/examples
The place I wish to do this is

C:\mec_dev

I have created a directory structure with the following.

c:\mec_dev\Web-Inf\web.xml
c:\mec_dev\Web-Inf\classes\HelloWorldExample.java (.class)


I have followed the instructions and done the following things.

- 1 -
Edited http.conf as follows

include "c:/tomcat/conf/my-tomcat-apache.conf"


- 2 -

Edited my-tomcat-apache.conf as follows

Alias /mec_dev C:\mec_dev
<Directory "C:\mec_dev">
    Options Indexes FollowSymLinks
</Directory>
ApJServMount /mec_dev/servlet /mec_dev
<Location /mec_dev/WEB-INF/ >
    AllowOverride None
    deny from all
</Location>

- 3 -

Edited server.xml as follows

<Context path="/mec_dev" docBase="C:\mec_dev" debug="9" reloadable="true">
</Context>

- 4 -

Created a web.xml file in C:\mec_dev\Web-Inf

like this

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
    <servlet>
        <servlet-name>
            HelloWorldExample
        </servlet-name>
        <servlet-class>
            HelloWorldExample
        </servlet-class>
    </servlet>

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

</web-app>


When I use the browser to hit
http://localhost:8080/examples/servlet/HelloWorldExample

The example pops up no problem, however when I hit

http://localhost:8080/mec_dev/servlet/HelloWorldExample

404 error, and the tomcat.log says....

Context log: path="/mec_dev" Can't find servet HelloWorldExample
Context log: path="/mec_dev" In error handler 404 null / R( /mec_dev +
/servlet/HelloWorldExample + null)
Context log: path="/mec_dev" Error: Calling servlet Wrapper(tomcat.errorPage
S:org.apache.tomcat.servlets.DefaultErrorPage)




Mime
View raw message