[jboss-as7-dev] jboss 7.1.1: asynclistener onErorr not called while closing browser
kushal soy
kushal.soy at gmail.com
Sat Sep 1 04:40:11 EDT 2012
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.
Let me know if this is valid case.
--------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);
>
> }
> });
>
>
> }
> }
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-as7-dev/attachments/20120901/b33e60bf/attachment.html
More information about the jboss-as7-dev
mailing list