On 11/13/2012 2:57 AM, Konstantin Kolinko wrote:
It looks like it overrides the default mapping of this servlet. If I
add the above fragment to web.xml of the docs application, I get 404
in Tomcat 7, while in Tomcat 6 it works.
If I replace above with the following, it works in Tomcat 7:
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/default/*</url-pattern>
<url-pattern>/</url-pattern>
</servlet-mapping>
(Well, I do not know your whole web.xml. Just trying/guessing what it might be.)
Servlet Spec 3.0 defines how web.xml fragments are merged. The
algorithm is a bit complicated. This affects how the global web.xml is
merged with webapp's one. (The change in the order of filters is one
known example mentioned in Migration Guide).
BTW, the effective merged web.xml can be printed into the log. There
is an attribute on <Context> that enables such logging.
Best regards,
Konstantin Kolinko
Hi again,
It appears that I can get rid of my default servlet remapping
completely. I've taken it out and adjusted my struts2 config and
everything appears to be working.
If memory serves (always dicey), I came up with this concept originally
with struts1 and tomcat5. I don't remember the exact circumstances, but
it solved the problem of the moment and I've been carrying this along as
the application and servers and frameworks have evolved. In this current
case, it appears to be completely unnecessary.
Thanks again,
Fred