想利用 实现 WebServletFace来写个servlet,似乎不支持
@WebServlet(urlPatterns = { "/test" }, asyncSupported = true)
public class Test extends HttpServlet implements WebServletFace{
protected void doGet(HttpServletRequest req, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/event-stream");
response.setCharacterEncoding("UTF-8");
req.setAttribute("org.apache.catalina.ASYNC_SUPPORTED", true);
AsyncContext actx = req.startAsync(req, response);//运行到这里报错
}
报错如下:
java.lang.IllegalStateException: !asyncSupported: whale@40d23c82==org.nutz.mvc.WhaleFilter,inst=true,async=false