Merge branch '1.5.x'
This commit is contained in:
commit
2017e763c3
|
|
@ -83,8 +83,6 @@ public class ErrorPageFilter implements Filter, ErrorPageRegistry {
|
||||||
|
|
||||||
private final Map<Class<?>, String> exceptions = new HashMap<Class<?>, String>();
|
private final Map<Class<?>, String> exceptions = new HashMap<Class<?>, String>();
|
||||||
|
|
||||||
private final Map<Class<?>, Class<?>> subtypes = new HashMap<Class<?>, Class<?>>();
|
|
||||||
|
|
||||||
private final OncePerRequestFilter delegate = new OncePerRequestFilter() {
|
private final OncePerRequestFilter delegate = new OncePerRequestFilter() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -217,19 +215,12 @@ public class ErrorPageFilter implements Filter, ErrorPageRegistry {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getErrorPath(Class<?> type) {
|
private String getErrorPath(Class<?> type) {
|
||||||
if (this.exceptions.containsKey(type)) {
|
while (type != Object.class) {
|
||||||
return this.exceptions.get(type);
|
String path = this.exceptions.get(type);
|
||||||
}
|
if (path != null) {
|
||||||
if (this.subtypes.containsKey(type)) {
|
return path;
|
||||||
return this.exceptions.get(this.subtypes.get(type));
|
|
||||||
}
|
|
||||||
Class<?> subtype = type;
|
|
||||||
while (subtype != Object.class) {
|
|
||||||
subtype = subtype.getSuperclass();
|
|
||||||
if (this.exceptions.containsKey(subtype)) {
|
|
||||||
this.subtypes.put(subtype, type);
|
|
||||||
return this.exceptions.get(subtype);
|
|
||||||
}
|
}
|
||||||
|
type = type.getSuperclass();
|
||||||
}
|
}
|
||||||
return this.global;
|
return this.global;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue