[JBoss AS 7 Development] - jboss 7.1.1: asynclistener onErorr not called while closing browser
by ksl
ksl [https://community.jboss.org/people/ksl] created the discussion
"jboss 7.1.1: asynclistener onErorr not called while closing browser"
To view the discussion, visit: https://community.jboss.org/message/757406#757406
--------------------------------------------------------------
I am testing simple application in jboss 7.1.1 final and servlet 3.0 feature. inside doGet/doPost I am starting AsynContext and adding the AsyncListener().
now when I am closing the browser, I am expecting it will hit the onError method, but it never.
where i am going wrorng?
--------code abstract----------------------
-
@WebServlet(urlPatterns = "/myPage", asyncSupported=true)
public class MyActionServlet extends HttpServlet {
public MyActionServlet(){
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
process(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
process(req,resp);
}
private void process(HttpServletRequest req, HttpServletResponse resp) {
System.out.println("Hello world");
req.getSession();
AsyncContext async = req.startAsync();
async.addListener(new AsyncListener() {
@Override
public void onTimeout(AsyncEvent event) throws IOException {
System.out.println("onTimeout:event::"+event);
}
@Override
public void onStartAsync(AsyncEvent arg0) throws IOException {
System.out.println("onstart::");
}
@Override
public void onError(AsyncEvent event) throws IOException {
System.out.println("onError.."+event);
}
@Override
public void onComplete(AsyncEvent event) throws IOException {
System.out.println("onComplete::"+event);
}
});
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/757406#757406]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 4 months