Author: pferraro
Date: 2009-05-18 17:45:14 -0400 (Mon, 18 May 2009)
New Revision: 2439
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java
Log:
Tweak redirect logic.
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java
===================================================================
---
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java 2009-05-18
21:33:26 UTC (rev 2438)
+++
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/BusyConnectorsLoadServlet.java 2009-05-18
21:45:14 UTC (rev 2439)
@@ -90,6 +90,8 @@
Thread.currentThread().interrupt();
}
}
+
+ this.writeLocalName(request, response);
}
else
{
@@ -98,11 +100,10 @@
if (end > System.currentTimeMillis())
{
String url = this.createLocalURL(request, Collections.singletonMap(END,
String.valueOf(end)));
- response.sendRedirect(response.encodeRedirectURL(url));
+ response.setStatus(307);
+ response.setHeader("location", response.encodeRedirectURL(url));
}
}
-
- this.writeLocalName(request, response);
}
private class ExecuteMethodTask implements Runnable
@@ -116,8 +117,6 @@
public void run()
{
- Thread.yield();
-
HttpClient client = new HttpClient();
String url = this.url;
@@ -130,7 +129,7 @@
int code = client.executeMethod(method);
- url = ((code >= 300) || (code < 400)) ?
method.getResponseHeader("location").getValue() : null;
+ url = (code == 307) ?
method.getResponseHeader("location").getValue() : null;
}
}
catch (HttpException e)
Show replies by date