taylor 2004/12/03 15:54:06
Modified: portal/src/java/org/apache/jetspeed/velocity
JetspeedVelocityViewServlet.java
Log:
another stellar patch from Randy Watler fixing Velocity logging!
Revision Changes Path
1.11 +24 -1
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
Index: JetspeedVelocityViewServlet.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- JetspeedVelocityViewServlet.java 2 Dec 2004 21:48:08 -0000 1.10
+++ JetspeedVelocityViewServlet.java 3 Dec 2004 23:54:06 -0000 1.11
@@ -16,6 +16,7 @@
package org.apache.jetspeed.velocity;
import java.io.File;
+import java.io.IOException;
import java.util.Locale;
import java.util.Map;
@@ -246,6 +247,28 @@
// fallback to global velocity engine singleton
return super.getTemplate(name, encoding);
+ }
+
+ /**
+ * Loads Velocity configuration information and returns that
+ * information as an ExtendedProperties, which will be used to
+ * initialize the Velocity runtime.
+ *
+ * @see
org.apache.velocity.tools.view.servlet.VelocityViewServlet.loadConfiguration()
+ *
+ * @param config ServletConfig passed to the servlets init() function.
+ * @return ExtendedProperties loaded with Velocity runtime configuration
values.
+ * @throws IOException I/O problem accessing the specified file, if
specified.
+ */
+ protected ExtendedProperties loadConfiguration(ServletConfig config)
+ throws IOException
+ {
+ // configure Velocity engines for Jetspeed Log4J logging
+ // delivered as "velocity" category
+ ExtendedProperties configuration = super.loadConfiguration(config);
+
configuration.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM_CLASS,
"org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
+ configuration.setProperty("runtime.log.logsystem.log4j.category",
"velocity");
+ return configuration;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]