You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2013/05/23 18:20:54 UTC

[Bug 54387] Having servlets with same url should at least cause warning

https://issues.apache.org/bugzilla/show_bug.cgi?id=54387

--- Comment #4 from Loïc Albertin <lo...@ow2.org> ---
Hi Mark,

I totally agree with the fact that an URL should be mapped to only one Servlet.
But, I'd like to have your point of view and maybe the one of the Servlet EG
about the following case.

Let's imagine that we have a Servlet annotated with @WebServlet("/an/url") and
a web.xml descriptor that define the same Servlet class with a different
logical name mapped to the same URL through a Servlet mapping.

>From my point of view this is actually the "same" Servlet which is mapped to
this URL and it doesn't contradict the updated paragraph in the Servlet
specification [1].

With the current Tomcat implementation this case will lead to a deployment
failure. My proposed solution is that when different Servlet names with the
same Servlet class are mapped to a same URL the first one defined will be
chosen. This will lead to prefer the one defined in the web descriptor over
annotations.
So, what do you think?

Thanks & regards,
Loïc


[1] "If the effective web.xml (after merging information from fragments and
annotations) contains any url-patterns that are mapped to multiple servlets
then the deployment must fail."

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org