ContinuationFilter+Continuation
API可以与Tomcat容器一起工作.也就是要让Tomcat这样的Servlet2.5
container(据说tomcat7会支持servlet3.0.目前的都是2.5)支持使用Continuation
API编程的Servlet,需要在web.xml中加入
<filter>
<filter-name>continuationFilter</filter-name>
<filter-class>org.eclipse.jetty.continuation.ContinuationFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>continuationFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
否则会抛throw new IllegalStateException("!(Jetty || Servlet 3.0 || ContinuationFilter)");
另外,对于jetty7,加不加该Filter没有影响.
<filter>
<filter-name>continuationFilter</filter-name>
<filter-class>org.eclipse.jetty.continuation.ContinuationFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>continuationFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
否则会抛throw new IllegalStateException("!(Jetty || Servlet 3.0 || ContinuationFilter)");
另外,对于jetty7,加不加该Filter没有影响.