This commit is contained in:
RedKale
2016-06-26 10:18:32 +08:00
parent 22ff684767
commit a0439518f3
2 changed files with 6 additions and 0 deletions

View File

@@ -19,9 +19,11 @@ import org.redkale.util.*;
* 详情见: http://redkale.org
*
* @author zhangjx
* @param <K> SessionID的类型
* @param <C> Context的子类型
* @param <R> Request的子类型
* @param <P> Response的子类型
* @param <S> Servlet的子类型
*/
public abstract class PrepareServlet<K extends Serializable, C extends Context, R extends Request<C>, P extends Response<C, R>, S extends Servlet<C, R, P>> extends Servlet<C, R, P> {

View File

@@ -89,6 +89,10 @@ public final class HttpPrepareServlet extends PrepareServlet<String, HttpContext
@Override
public void addServlet(HttpServlet servlet, Object prefix, AnyValue conf, String... mappings) {
if (prefix == null) prefix = "";
if (mappings.length < 1) {
WebServlet ws = servlet.getClass().getAnnotation(WebServlet.class);
if (ws != null) mappings = ws.value();
}
for (String mapping : mappings) {
if (!prefix.toString().isEmpty()) mapping = prefix + mapping;
if (this.mapStrings.containsKey(mapping)) {