diff --git a/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/Servlet3Continuation.java b/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/Servlet3Continuation.java index 3a387de9aec..12e29cb2f63 100644 --- a/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/Servlet3Continuation.java +++ b/jetty-continuation/src/main/java/org/eclipse/jetty/continuation/Servlet3Continuation.java @@ -166,7 +166,17 @@ public class Servlet3Continuation implements Continuation @Override public boolean isSuspended() { - return _request.isAsyncStarted(); + if (_request.isAsyncStarted()) + return true; + try + { + return _request.getAsyncContext()!=null; + } + catch(IllegalStateException e) + { + // ignored + } + return false; } /* ------------------------------------------------------------ */ diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java index b580242c96d..d070aeee673 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java @@ -570,8 +570,6 @@ public class HttpChannelState switch(_state) { case ASYNCSTARTED: - case REDISPATCHING: - case COMPLETECALLED: case ASYNCWAIT: return true; diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterHolder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterHolder.java index e69910480a7..b63e40a3c66 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterHolder.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/FilterHolder.java @@ -53,7 +53,7 @@ public class FilterHolder extends Holder */ public FilterHolder() { - super (Source.EMBEDDED); + this(Source.EMBEDDED); } @@ -62,7 +62,7 @@ public class FilterHolder extends Holder */ public FilterHolder(Holder.Source source) { - super (source); + super(source); } /* ---------------------------------------------------------------- */ @@ -70,7 +70,7 @@ public class FilterHolder extends Holder */ public FilterHolder(Class filter) { - super (Source.EMBEDDED); + this(Source.EMBEDDED); setHeldClass(filter); } @@ -79,7 +79,7 @@ public class FilterHolder extends Holder */ public FilterHolder(Filter filter) { - super (Source.EMBEDDED); + this(Source.EMBEDDED); setFilter(filter); } diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java index 9c12e3ec947..a7778a974ad 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java @@ -57,7 +57,7 @@ public class Holder extends AbstractLifeCycle implements Dumpable protected String _className; protected String _displayName; protected boolean _extInstance; - protected boolean _asyncSupported=true; + protected boolean _asyncSupported; /* ---------------------------------------------------------------- */ protected String _name; @@ -67,8 +67,19 @@ public class Holder extends AbstractLifeCycle implements Dumpable protected Holder(Source source) { _source=source; + switch(_source) + { + case JAVAX_API: + case DESCRIPTOR: + case ANNOTATION: + _asyncSupported=false; + break; + default: + _asyncSupported=true; + } } + /* ------------------------------------------------------------ */ public Source getSource() { return _source; diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java index 28fce428303..3a13a3f813c 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java @@ -93,7 +93,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope */ public ServletHolder() { - super (Source.EMBEDDED); + this(Source.EMBEDDED); } /* ---------------------------------------------------------------- */ @@ -101,7 +101,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope */ public ServletHolder(Holder.Source creator) { - super (creator); + super(creator); } /* ---------------------------------------------------------------- */ @@ -109,7 +109,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope */ public ServletHolder(Servlet servlet) { - super (Source.EMBEDDED); + this(Source.EMBEDDED); setServlet(servlet); } @@ -118,7 +118,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope */ public ServletHolder(String name, Class servlet) { - super (Source.EMBEDDED); + this(Source.EMBEDDED); setName(name); setHeldClass(servlet); } @@ -128,7 +128,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope */ public ServletHolder(String name, Servlet servlet) { - super (Source.EMBEDDED); + this(Source.EMBEDDED); setName(name); setServlet(servlet); } @@ -138,7 +138,7 @@ public class ServletHolder extends Holder implements UserIdentity.Scope */ public ServletHolder(Class servlet) { - super (Source.EMBEDDED); + this(Source.EMBEDDED); setHeldClass(servlet); }