tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Isaacs <Larry.Isa...@sas.com>
Subject RE: servlets path in tomcat 3.3
Date Thu, 25 Oct 2001 17:39:12 GMT
Hi Mathieu,

RequestInterceptor is still supported, but not used because modules.xml
provides for simpler syntax in the server.xml.  Thus, the
InvokerInterceptor is still there in server.xml, but it appears as:

    <InvokerInterceptor />

The class for InvokerInterceptor is now
org.apache.tomcat.modules.generators.InvokerInterceptor.  Unfortunately,
it has lost its ability to set the prefix, which is hardcoded to
"/servlet/".  I'll add the prefix property back in for Tomcat 3.3.1.
In the meantime, you could use the PasswordPrompter.war add-on module
as an example of how to create a MyInvokerInterceptor add-on module.
Modify the InvokerInterceptor source to allow the prefix to be set.
Your "interceptors.xml" might look like:

<?xml version="1.0" encoding="UTF-8"?>
<Server>
    <module name="MyInvokerInterceptor"
        javaClass="org.apache.tomcat.modules.generators.MyInvokerInterceptor" />
    <ContextManager>
        <MyInvokerInterceptor prefix="/myprefix/" />
    </ContextManager>
</Server>

Hope this helps.

Cheers,
Larry

> -----Original Message-----
> From: mathieu [mailto:mathieu@kesako.ch]
> Sent: Wednesday, October 24, 2001 5:10 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: servlets path in tomcat 3.3
> 
> 
> That's fine for a couple of servlets, but I have more than 
> 6500 servlets, I 
> can't map them all by hand.
> In Tomcat 3.2, the RequestInvoker had a prefix argument which 
> could be used 
> to redirect matching paths to servlets
> 
> <RequestInterceptor
>             className="org.apache.tomcat.request.InvokerInterceptor"
>             debug="0" prefix="/servlet/" />
> 
> With prefix="/", I could forward any request to servlets 
> without using 
> "/servlet/" in the url.
> Where is the RequestInterceptor gone?
> 
> > Add a servlet-mapping to your web.xml file.
> >
> > <servlet-mapping>
> >   <servlet-name>
> >     SnoopServlet
> >   </servlet-name>
> >   <url-pattern>
> >     /SnoopServlet
> >   </url-pattern>
> > </servlet-mapping>
> >
> > mperreno wrote:
> > > Is it possible to use non-standard paths for servlet i.e. use map
> > > anything after the context name to servlets:
> > > www.foobar.com/foo/SnoopServlet
> > > instead of
> > > www.foobar.com/foo/servlet/SnoopServlet
> > >
> > > I managed to do it with tomcat 3.2 but I can't do it with 
> tomcat 3.3
> > >
> > > thanks
> > >
> > > --
> > > mathieu perrenoud [iis]
> 
> -- 
> mathieu perrenoud [kesako]
> 

Mime
View raw message