package bug; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.AsyncEvent; import javax.servlet.AsyncListener; import javax.servlet.http.HttpServletResponse; public class SRAsynchContextListener implements AsyncListener { @Override public void onComplete(AsyncEvent arg0) throws IOException { // TODO Auto-generated method stub } @Override public void onError(AsyncEvent arg0) throws IOException { // TODO Auto-generated method stub } @Override public void onStartAsync(AsyncEvent arg0) throws IOException { // TODO Auto-generated method stub } @Override public void onTimeout(AsyncEvent ae) throws IOException { HttpServletResponse response = (HttpServletResponse) ae.getAsyncContext().getResponse(); PrintWriter pw = response.getWriter(); pw.println("hej"); pw.flush(); pw.close(); } }