You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Toby Piper <tp...@packeteer.com> on 2000/11/22 22:35:42 UTC

Does servlet mapping work in Tomcat 3.1?

Hi All,

I am trying to get servlet mapping to work in my web app. I have tried the
various examples given in the docs and it still doesn't work.

I have seen some other queries about this in the archives but no responses.

Clearly the docs indicate that Tomcat is supposed to support servlet mapping.
Does anyone know if this is working?

Here's what I want to do:

I want this URI:

   http://host:8080/myApp/MyMap

to invoke my servlet named login.


I have this context set up in server.xml:

        <Context path="/myApp"
                 docBase="C:\MyApp"
                 debug="0"
                 reloadable="false" >
        </Context>

In my Apps web.xml file I have:

	<servlet-mapping>
		<servlet-name>Login</servlet-name>
        <url-pattern>/MyMap</url-pattern>
	</servlet-mapping>

	<servlet>
		<servlet-name>Login</servlet-name>
		<servlet-class>Login</servlet-class>
	</servlet>

I CAN access the servlet directly by http://host:8080/myApp/servlet/Login

but not by http://host:8080/myApp/MyMap

What am I doing wrong?

I'm using tomcat 3.1 latest stable release on Win NT 4.0.

Thanks in advance,
Toby


Re: Does servlet mapping work in Tomcat 3.1?

Posted by Kurt Bernhard Pruenner <le...@gmx.at>.
Toby Piper wrote:
> In my Apps web.xml file I have:
> 
>         <servlet-mapping>
>                 <servlet-name>Login</servlet-name>
>         <url-pattern>/MyMap</url-pattern>
>         </servlet-mapping>
> 
>         <servlet>
>                 <servlet-name>Login</servlet-name>
>                 <servlet-class>Login</servlet-class>
>         </servlet>

Try swapping the <servlet> and <servlet-mapping> tags; IIRC <servlet> has to
come before <servlet-mapping> or it won't work...

-- 
Kurt Bernhard Pruenner --- Haendelstrasse 17 --- 4020 Linz --- Austria
Music: http://www.mp3.com/Leak --- Work: http://www.ssw.uni-linz.ac.at
.......It might be written "Mindfuck", but it's spelt "L-A-I-N".......
np: Two Lone Swordsmen - Foreververb (Tiny Reminders)