this patch adds a toString() method to
org.apache.catalina.core.ApplicationContext.
why does ApplicationContext need a toString() method? so that logging
code can print out something meaningful when the context is passed in!
BTW i'm not currently subscribed to tomcat-dev so any communication
needs to be directed to my account (rather than the list).
- robert
Index: catalina/src/share/org/apache/catalina/core/ApplicationContext.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ApplicationContext.java,v
retrieving revision 1.19
diff -u -r1.19 ApplicationContext.java
--- catalina/src/share/org/apache/catalina/core/ApplicationContext.java 2001/04/06
19:31:17 1.19
+++ catalina/src/share/org/apache/catalina/core/ApplicationContext.java 2001/04/21
+12:25:52
@@ -837,6 +837,21 @@
}
+ /**
+ * Returns something meaningful.
+ * This returns "Servlet Context " + the display name + "(" + the context name +
+")".
+ * Useful for logging.
+ */
+ public String toString()
+ {
+ String ret="Servlet Context ";
+ if (getServletContextName()!=null)
+ {
+ ret += getServletContextName();
+ }
+
+ return ret + " (" + context.getName() + ") ";
+ }
// -------------------------------------------------------- Private Methods