405526 Deployment must fail if more than 1 servlet maps to same url pattern

This commit is contained in:
Jan Bartel 2013-05-10 15:33:57 +10:00
parent bd153af2e2
commit 215d2e2095

View File

@ -1278,7 +1278,11 @@ public class ServletHandler extends ScopedHandler
String[] pathSpecs = servletmapping.getPathSpecs();
for (String pathSpec : pathSpecs)
if (pathSpec != null)
pm.put(pathSpec, servlet_holder);
{
ServletHolder previous = pm.put(pathSpec, servlet_holder);
if (previous != null)
throw new IllegalStateException("Multiple servlets map to path: "+pathSpec);
}
}
}