> On Tue, 12 Jun 2001, Remy Maucherat wrote:
>
> > Hi,
> >
> > I have the impression that we're always loading the default web.xml,
even if
> > the webapp already contains one, and add to the mappings which are
defined
> > there.
> >
>
> Yep.  Tomcat loads the default mappings from this file, then it loads your
> own mappings (which override anything set in the defaults).
>
> > I think it's ok when no mapping are defined, or no mapping is defined on
the
> > root node, but it's not as soon as a mapping is defined on either / or
/*
> > (which would indicate that the user wants to have all requests in the
webapp
> > handled by a particular servlet).
> >
> > Here, I'd like to have one servlet handle everything, including *.jsp,
while
> > leaving the default web.xml intact (so that Jasper is still active in
other
> > contexts) ;-)
> >
>
> If you map to "/*" in your own web.xml, it overrides any "*.jsp" mappings
> in the defaults (because of the priority ordering defined in the servlet
> spec).  What is it that you feel you cannot do?

Well, it insisted to map "/" on the default servlet (so that 127.0.0.1:8080
was going to my servlet; 127.0.0.1:8080/ was going to the default servlet;
the rest should go to my servlet). I didn't try again wo see if Jasper was
active, but it was still set as a servlet mapping in my context (according
to the logs), which of course isn't that useful.

The code loads the default config before the app config.
Perhaps what we could do when we add a new mapping from the app config is
remove the redundant mappings.

I added a new feature to my custom host as a workaround : it retrieves the
array of children, parses the servlet mappings, and removes anything which
isn't mapped to "/*". I don't need reloading at all on that host, so I think
I should be ok.

Remy

Reply via email to