Author: pferraro
Date: 2009-05-18 15:54:34 -0400 (Mon, 18 May 2009)
New Revision: 2432
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/LoadServlet.java
Log:
don't use connector domain
Modified:
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/LoadServlet.java
===================================================================
---
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/LoadServlet.java 2009-05-18
18:12:56 UTC (rev 2431)
+++
trunk/mod_cluster/src/demo/java/org/jboss/modcluster/demo/servlet/LoadServlet.java 2009-05-18
19:54:34 UTC (rev 2432)
@@ -68,7 +68,7 @@
{
ServletContext context = config.getServletContext();
context.setAttribute(PORT, Integer.valueOf(connector.getPort()));
- context.setAttribute(HOST, connector.getDomain());
+// context.setAttribute(HOST, connector.?);
}
}
@@ -84,9 +84,14 @@
protected String createLocalURL(HttpServletRequest request, Map<String, String>
parameterMap)
{
ServletContext context = this.getServletContext();
- String host = (String) context.getAttribute(HOST);
- Integer port = (Integer) context.getAttribute(PORT);
- return this.createURL(request, (host != null) ? host :
System.getProperty("jboss.bind.address", "localhost"), (port != null)
? port.intValue() : request.getLocalPort(), parameterMap);
+
+ String contextHost = (String) context.getAttribute(HOST);
+ String host = (contextHost != null) ? contextHost :
System.getProperty("jboss.bind.address", request.getLocalName());
+
+ Integer contextPort = (Integer) context.getAttribute(PORT);
+ int port = (contextPort != null) ? contextPort.intValue() :
request.getLocalPort();
+
+ return this.createURL(request, host, port, parameterMap);
}
private String createURL(HttpServletRequest request, String host, int port,
Map<String, String> parameterMap)