Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Asynchronous servlet, onComplete() is not called when error occurs
- Loading branch information
1 parent
cff7c3e
commit c3b84a9
Showing
2 changed files
with
63 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
.../src/test/java/io/undertow/servlet/test/listener/request/async/onError/AsyncServlet4.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.undertow.servlet.test.listener.request.async.onError; | ||
|
||
import java.io.IOException; | ||
|
||
import javax.servlet.AsyncContext; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
/** | ||
* Exception occurs during its processing. No in delegated dispatch part. | ||
* | ||
*/ | ||
public class AsyncServlet4 extends HttpServlet { | ||
|
||
@Override | ||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | ||
AsyncContext ctx = req.startAsync(); | ||
ctx.addListener(new AsyncEventListener()); | ||
ctx.addListener(new SimpleAsyncListener(ctx)); | ||
throw new NullPointerException(); | ||
} | ||
|
||
} |