tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remy Maucherat" <>
Subject Re: Always loading default web.xml ?
Date Wed, 13 Jun 2001 17:42:19 GMT
> 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
> > 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
> > 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
> > handled by a particular servlet).
> >
> > Here, I'd like to have one servlet handle everything, including *.jsp,
> > leaving the default web.xml intact (so that Jasper is still active in
> > 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
was going to my servlet; 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.


View raw message