public void dispatch() {
HttpServletRequest sr = (HttpServletRequest)getServletRequest();
String path = sr.getRequestURI();
+ String cpath = sr.getContextPath();
+ if (cpath.length()>1) path = path.substring(cpath.length());
dispatch(path);
}
//this is the same as
//request.startAsync().complete();
recycle();
- } else if (state.compareAndSet(AsyncState.DISPATCHED, AsyncState.NOT_STARTED) ||
- state.compareAndSet(AsyncState.COMPLETING, AsyncState.NOT_STARTED)) {
+ } else if (state.compareAndSet(AsyncState.COMPLETING, AsyncState.NOT_STARTED)) {
for (AsyncListenerWrapper wrapper : listeners) {
try {
wrapper.fireOnComplete();
log.info("Received dispatch, completing on the worker thread.");
req.getAsyncContext().complete();
log.info("After complete called started:"+req.isAsyncStarted());
- resp.getWriter().write("Async dispatch worked\n");
+ resp.getWriter().write("Async dispatch worked:+"+System.currentTimeMillis()+"\n");
} else {
resp.setContentType("text/plain");
final AsyncContext actx = req.startAsync();
- actx.setAsyncTimeout(30*1000);
+ actx.setAsyncTimeout(Long.MAX_VALUE);
Runnable run = new Runnable() {
public void run() {
try {
request.getAsyncContext().complete();
}
%>
-Completed async request.
\ No newline at end of file
+Completed async request at <%=new java.sql.Date()%>
\ No newline at end of file