You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Pascal Bourachot <pa...@trema.com> on 2000/11/20 15:31:44 UTC

Tomcat 3.1 : Servlet URl without "/servlet/"

I have a servlet called "myServlet"

and i have defined  a context "foo"

How i can access to this servlet whitout "servlet" in the url ->
http://locahost/foo/servlet/myServlet

I will prefer to access it with http://localhost/foo/myServlet.

I saw that with Tomcat 3.2b-8, we can use

	<RequestInterceptor
>         className="org.apache.tomcat.request.InvokerInterceptor"
>         debug="0" prefix="/servlet/" />

but i use tomcat 3.1.


Thanks

scal.


Re: Tomcat 3.1 : Servlet URl without "/servlet/"

Posted by Miles Daffin <mi...@cwcom.net>.
Hi Scal,

> I have a servlet called "myServlet"
> and i have defined  a context "foo"
>
> How i can access to this servlet whitout "servlet" in the url ->
> http://locahost/foo/servlet/myServlet

Try doing this in your apps web.xml (in the etc dir??).

<servlet>
   <servlet-name>
       myServlet
   </servlet-name>
   <description>
       No description as yet.
   </description>
   <servlet-class>
      SomeFoolServlet
   </servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>myServlet</servlet-name>
   <url-pattern>/myServlet</url-pattern>
</servlet-mapping>

This works for me - doing this it seems you can get TomCat to deal with
Servlets ANYWHERE.

Someone please tell me if there is something wrong with this or if I have
missed some vital point
(if you have the time...).

> I will prefer to access it with http://localhost/foo/myServlet.

If you do the above this is exactly what will  happen.

Miles