From issues at jboss.org Sun Mar 29 21:10:19 2015 Content-Type: multipart/mixed; boundary="===============3050340384089781063==" MIME-Version: 1.0 From: Stuart Douglas (JIRA) To: jboss-jira at lists.jboss.org Subject: [jboss-jira] [JBoss JIRA] (WFLY-4352) Servlet 3 - async-mode - onComplete not tirggered when JSP is dispatched Date: Sun, 29 Mar 2015 21:10:19 -0400 Message-ID: In-Reply-To: JIRA.12563244.1424075581000@Atlassian.JIRA --===============3050340384089781063== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable [ https://issues.jboss.org/browse/WFLY-4352?page=3Dcom.atlassian.jira.= plugin.system.issuetabpanels:all-tabpanel ] Stuart Douglas resolved WFLY-4352. ---------------------------------- Fix Version/s: 9.0.0.Beta2 Resolution: Done > Servlet 3 - async-mode - onComplete not tirggered when JSP is dispatched > ------------------------------------------------------------------------ > > Key: WFLY-4352 > URL: https://issues.jboss.org/browse/WFLY-4352 > Project: WildFly > Issue Type: Feature Request > Components: Web (Undertow) > Affects Versions: 8.2.0.Final > Reporter: G=C3=BCnther Grill > Assignee: Stuart Douglas > Labels: async, asynchronous, jsp, servlet > Fix For: 9.0.0.Beta2 > > Attachments: AsyncServlet.war > > > When a JSP is dispatched in a Async-Servlet, the {{AsyncListener#onComple= te}} is never triggered. > {code:title=3DAsyncServlet.java|borderStyle=3Dsolid} > @WebServlet(urlPatterns =3D { "/AsyncServlet" }, asyncSupported =3D true) > public class AsyncServlet extends HttpServlet { > public AsyncServlet() { > super(); > } > @Override > protected void doGet(HttpServletRequest req, HttpServletResponse res) th= rows ServletException, IOException { > res.setContentType("text/html"); > final AsyncContext ac; > if (req.isAsyncStarted()) { > ac =3D req.getAsyncContext(); > } else { > ac =3D req.startAsync(); > } > ac.setTimeout(5000); > ac.addListener(new AsyncListener() { > @Override > public void onTimeout(AsyncEvent event) throws IOException { > System.out.println("onTimeout"); > } > @Override > public void onStartAsync(AsyncEvent event) throws IOException { > System.out.println("onStartAsync"); > } > @Override > public void onError(AsyncEvent event) throws IOException { > System.out.println("onError"); > } > @Override > public void onComplete(AsyncEvent event) throws IOException { > System.out.println("onComplete"); > } > }); > System.out.println("Calling JSP..."); > ac.dispatch("/result.jsp"); > System.out.println("After JSP call"); > } > } > {code} > {code:title=3Dresult.jsp|borderStyle=3Dsolid} > <%@ page language=3D"java" contentType=3D"text/html; charset=3DISO-8859-1" > pageEncoding=3D"ISO-8859-1"%> > > > > > AsyncServletTest > > >

JSP Content

> <% > System.out.println("Start JSP"); > Thread.sleep(1000); // sleep 1 seconds > String resp =3D (String)request.getAttribute("result"); > resp =3D resp + "

on JSP

"; > Thread.sleep(1000); // sleep 1 seconds > System.out.println("End JSP"); > %> >

<%=3Dresp%>

> > > {code} -- This message was sent by Atlassian JIRA (v6.3.11#6341) --===============3050340384089781063==--