Author: fhanik
Date: Wed Aug 5 23:58:18 2009
New Revision: 801472
URL: http://svn.apache.org/viewvc?rev=801472&view=rev
Log:
path adjustments
Modified:
tomcat/trunk/java/org/apache/catalina/connector/AsyncContextImpl.java
tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async0.java
tomcat/trunk/webapps/examples/jsp/async/async1.jsp
Modified: tomcat/trunk/java/org/apache/catalina/connector/AsyncContextImpl.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/AsyncContextImpl.java?rev=801472&r1=801471&r2=801472&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/AsyncContextImpl.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/connector/AsyncContextImpl.java Wed
Aug 5 23:58:18 2009
@@ -84,6 +84,8 @@
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);
}
@@ -267,8 +269,7 @@
//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();
Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async0.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async0.java?rev=801472&r1=801471&r2=801472&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async0.java (original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async0.java Wed Aug 5
23:58:18 2009
@@ -38,11 +38,11 @@
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 {
Modified: tomcat/trunk/webapps/examples/jsp/async/async1.jsp
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/jsp/async/async1.jsp?rev=801472&r1=801471&r2=801472&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/jsp/async/async1.jsp (original)
+++ tomcat/trunk/webapps/examples/jsp/async/async1.jsp Wed Aug 5 23:58:18 2009
@@ -7,4 +7,4 @@
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]