Author: darran.lofthouse(a)jboss.com
Date: 2009-01-08 10:49:23 -0500 (Thu, 08 Jan 2009)
New Revision: 8992
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java
Log:
[JBWS-2443] services page does not correctly update host address of endpoints.
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java 2009-01-08
15:05:40 UTC (rev 8991)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java 2009-01-08
15:49:23 UTC (rev 8992)
@@ -103,7 +103,8 @@
writer.print("</tr>");
writer.print("<tr>");
writer.print(" <td>Endpoint Address</td>");
- writer.print(" <td><a href='" + ep.getAddress() +
"?wsdl'>" + ep.getAddress() + "?wsdl</a></td>");
+ String address = createAddress(requestURL, ep.getAddress());
+ writer.print(" <td><a href='" + address +
"?wsdl'>" + address + "?wsdl</a></td>");
writer.print("</tr>");
writer.print("<tr>");
writer.print(" <td colspan=2>");
@@ -179,4 +180,30 @@
writer.println("<link rel='stylesheet'
href='./styles.css'>");
writer.println("</head>");
}
+
+ private String createAddress(final URL requestURL, final String endpointAddress)
throws IOException
+ {
+ String address = endpointAddress;
+ if (address.contains(ServerConfig.UNDEFINED_HOSTNAME))
+ {
+ URL internalAddress = new URL(address);
+
+ String protocol = requestURL.getProtocol();
+ String host = requestURL.getHost();
+ int port = requestURL.getPort();
+ String path = internalAddress.getPath();
+
+ if (port > -1)
+ {
+ address = new URL(protocol, host, port, path).toString();
+ }
+ else
+ {
+ address = new URL(protocol, host, path).toString();
+ }
+ }
+
+ return address;
+ }
+
}
Show replies by date