You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2002/05/04 22:05:14 UTC
cvs commit: jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin Lists.java
remm 02/05/04 13:05:14
Modified: webapps/admin/WEB-INF/classes/org/apache/webapp/admin
Lists.java
Log:
- "Fix" the code which returns the service name on which the admin webapp is running.
Unfortunately, the result is not exact, because there is no way I can think of
to get the host on which the request was mapped using the servlet API
(getServerName() will return the host name specified by the client).
Revision Changes Path
1.9 +23 -22 jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/Lists.java
Index: Lists.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/Lists.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Lists.java 26 Apr 2002 19:05:12 -0000 1.8
+++ Lists.java 4 May 2002 20:05:14 -0000 1.9
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/Lists.java,v 1.8 2002/04/26 19:05:12 manveen Exp $
- * $Revision: 1.8 $
- * $Date: 2002/04/26 19:05:12 $
+ * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/Lists.java,v 1.9 2002/05/04 20:05:14 remm Exp $
+ * $Revision: 1.9 $
+ * $Date: 2002/05/04 20:05:14 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@
* is returned.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.8 $ $Date: 2002/04/26 19:05:12 $
+ * @version $Revision: 1.9 $ $Date: 2002/05/04 20:05:14 $
*/
public class Lists {
@@ -599,6 +599,7 @@
}
+
/**
* Return the <code>Service</code> object name string
* that the admin app belongs to.
@@ -608,25 +609,25 @@
*
* @exception Exception if thrown while retrieving the list
*/
- public static String getAdminAppService(MBeanServer mbserver,
- String domain, HttpServletRequest request)
+ public static String getAdminAppService
+ (MBeanServer mbserver, String domain, HttpServletRequest request)
throws Exception {
- // Get the admin app's service name
- StringBuffer sb = new StringBuffer(domain);
- sb.append(":type=Context");
- sb.append(",path=");
- sb.append(request.getContextPath());
- sb.append(",host=");
- sb.append(request.getServerName());
- sb.append(",*");
- ObjectName search = new ObjectName(sb.toString());
- Iterator names = mbserver.queryNames(search, null).iterator();
- String service = null;
- while (names.hasNext()) {
- service = ((ObjectName)names.next()).getKeyProperty("service");
- }
- return service;
+ // Get the admin app's service name
+ StringBuffer sb = new StringBuffer(domain);
+ sb.append(":type=Context");
+ sb.append(",path=");
+ sb.append(request.getContextPath());
+ sb.append(",*");
+ ObjectName search = new ObjectName(sb.toString());
+ Iterator names = mbserver.queryNames(search, null).iterator();
+ String service = null;
+ while (names.hasNext()) {
+ service = ((ObjectName)names.next()).getKeyProperty("service");
+ }
+ return service;
+
}
-
+
+
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>