This commit is contained in:
@@ -109,10 +109,7 @@ public final class HttpPrepareServlet extends PrepareServlet<String, HttpContext
|
|||||||
for (String mapping : mappings) {
|
for (String mapping : mappings) {
|
||||||
if (mapping == null) continue;
|
if (mapping == null) continue;
|
||||||
if (!prefix.toString().isEmpty()) mapping = prefix + mapping;
|
if (!prefix.toString().isEmpty()) mapping = prefix + mapping;
|
||||||
if (this.allMapStrings.containsKey(mapping)) {
|
|
||||||
Class old = this.allMapStrings.get(mapping);
|
|
||||||
throw new RuntimeException("mapping [" + mapping + "] repeat on " + old.getName() + " and " + servlet.getClass().getName());
|
|
||||||
}
|
|
||||||
if (contains(mapping, '.', '*', '{', '[', '(', '|', '^', '$', '+', '?', '\\')) { //是否是正则表达式))
|
if (contains(mapping, '.', '*', '{', '[', '(', '|', '^', '$', '+', '?', '\\')) { //是否是正则表达式))
|
||||||
if (mapping.charAt(0) != '^') mapping = '^' + mapping;
|
if (mapping.charAt(0) != '^') mapping = '^' + mapping;
|
||||||
if (mapping.endsWith("/*")) {
|
if (mapping.endsWith("/*")) {
|
||||||
@@ -130,6 +127,10 @@ public final class HttpPrepareServlet extends PrepareServlet<String, HttpContext
|
|||||||
} else if (mapping != null && !mapping.isEmpty()) {
|
} else if (mapping != null && !mapping.isEmpty()) {
|
||||||
super.mappings.put(mapping, servlet);
|
super.mappings.put(mapping, servlet);
|
||||||
}
|
}
|
||||||
|
if (this.allMapStrings.containsKey(mapping)) {
|
||||||
|
Class old = this.allMapStrings.get(mapping);
|
||||||
|
throw new RuntimeException("mapping [" + mapping + "] repeat on " + old.getName() + " and " + servlet.getClass().getName());
|
||||||
|
}
|
||||||
this.allMapStrings.put(mapping, servlet.getClass());
|
this.allMapStrings.put(mapping, servlet.getClass());
|
||||||
}
|
}
|
||||||
setServletConf(servlet, conf);
|
setServletConf(servlet, conf);
|
||||||
|
|||||||
Reference in New Issue
Block a user