On Mon, 22 Jul 2002, Mark Beecroft wrote:

> Date: Mon, 22 Jul 2002 15:21:52 +0100
> From: Mark Beecroft <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>,
>      [EMAIL PROTECTED]
> To: Tomcat Users List <[EMAIL PROTECTED]>,
>      "Cox, Charlie" <[EMAIL PROTECTED]>
> Subject: Re: filtering --> 2 servlets
>
> Charlie,
>
> Well it's not quite that simple. You see Servlet B is the "default" Servlet
> and its web.xml file gets processed in advance of mine, so I am left with
> the problem of how to specify the search pattern "everything but *.html".
>

The default servlet mapping ("/") really is just that -- a default for
requests that are not mapped to *any* other servlet.  Therefore, if you
have a mapping for "/*", for example, the default servlet would never get
invoked.

You might want to rethink trying to use a default servlet mapping in the
first place.  Among other things, that is how Tomcat implements static
file serving, so you will already have to re-implement that if your webapp
needs it.

> Further thoughts?
>
> Cheers,
> Mark
>

Craig


>
>
> On Monday 22 July 2002 12:24 pm, Cox, Charlie wrote:
> > I'm not sure you need filters for this.
> >
> > define your servlet mapping in web.xml to be *.html
> >
> > Then you can set up a <welcome-file-list> to go to index.html, which would
> > route to your servlet based on it ending with .html
> >
> > it's that simple.
> >
> > Charlie
> >
> > > -----Original Message-----
> > > From: Mark Beecroft [mailto:[EMAIL PROTECTED]]
> > > Sent: Sunday, July 21, 2002 8:30 PM
> > > To: Tomcat Users List; Jacob Kjome
> > > Subject: filtering --> 2 servlets
> > >
> > >
> > > Good morning/afternoon/evening,
> > >
> > > I am using Tomcat 4 and have 2 servlets between which I would
> > > like to split
> > > processing. Servlet A needs to process all requests
> > > corresponding to the
> > > patterns "*.html", "*.html" and "/". Servlet B needs to
> > > process all other
> > > requests. The short question is how can I do this?
> > >
> > > I am currently using filters but am finding it difficult to
> > > cater for the
> > > pattern "/". The only option seems to be the use of the url
> > > mapping "/*"
> > > to invoke a filter class, but then how does processing get to
> > > Servlet B? If I
> > > only invoke chain.doFilter() when the pathinfo satisfies the
> > > conditions of
> > > Servlet A then I can get Servlet A working normally, but
> > > there seems no way
> > > of ever invoking Servlet B with such a configuration. To demonstrate:
> > >
> > > http://www.domainname.com/index.html --> Servlet A
> > > http://www.domainname.com/whatever.htm --> Servlet A
> > > http://www.domainname.com/ --> servlet A
> > > http://www.domainname.com/image.jpeg --> no Servlet accessed
> > >
> > > What I really would like is a more versatile url-pattern
> > > element, but does
> > > anyone have a solution for my current situation... please...
> > >
> > > Cheers,
> > > Mark
> > > P.S. If you help me out I'll by you a pint when you next come
> > > to England!
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to