This commit is contained in:
Redkale
2018-09-05 16:41:44 +08:00
parent 6a8c60ec78
commit f3763dbf72
2 changed files with 4 additions and 1 deletions

View File

@@ -126,7 +126,8 @@ public class HttpPrepareServlet extends PrepareServlet<String, HttpContext, Http
List<HttpServlet> list = removeHttpServlet(predicateEntry, predicateFilter);
return list == null || list.isEmpty() ? null : list.get(0);
}
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked")
public <T extends WebSocket> HttpServlet removeHttpServlet(Class<T> websocketOrServletType) {
Predicate<MappingEntry> predicateEntry = (t) -> {
Class type = t.servlet.getClass();
@@ -379,6 +380,7 @@ public class HttpPrepareServlet extends PrepareServlet<String, HttpContext, Http
servlet._prefix = prefix.toString();
putServlet(servlet);
}
servlet.preInit(null, conf);
}
/**

View File

@@ -84,6 +84,7 @@ public class HttpServlet extends Servlet<HttpContext, HttpRequest, HttpResponse>
@SuppressWarnings("unchecked")
void preInit(HttpContext context, AnyValue config) {
if (this.mappings != null) return; //无需重复preInit
String path = _prefix == null ? "" : _prefix;
WebServlet ws = this.getClass().getAnnotation(WebServlet.class);
if (ws != null && !ws.repair()) path = "";