I think it's backwards compatible :)
+1
On 2/6/02 6:28 PM, "Daniel Rall" <[EMAIL PROTECTED]> wrote:
> The following patch makes configuring a bevy of VelocityServlet
> subclasses much easier, allowing the path to the velocity.properties
> file to be defined once for the entire context (or defined as a fall
> back for the case where no servlet-specific velocity.properties path
> is defined). I'll go ahead and commit this if no one has any problems
> with it.
>
> Dan
>
>
> Index: VelocityServlet.java
> ===================================================================
> RCS file:
> /home/cvs/jakarta-velocity/src/java/org/apache/velocity/servlet/VelocityServle
> t.java,v
> retrieving revision 1.43
> diff -u -u -r1.43 VelocityServlet.java
> --- VelocityServlet.java 7 Dec 2001 00:01:55 -0000 1.43
> +++ VelocityServlet.java 6 Feb 2002 23:25:52 -0000
> @@ -248,11 +248,11 @@
> * VelocityServlet.INIT_PROPS_KEY, which should be a file containing
> * the configuration information.
> * <br><br>
> - * To configure your Servlet Spec 2.2 compliant servlet runner to pass
> this
> - * to you, put the following in your WEB-INF/web.xml file
> + * To configure your Servlet Spec 2.2 compliant servlet runner to pass
> + * this to you, put the following in your WEB-INF/web.xml file
> * <br>
> * <pre>
> - * <servlet >
> + * <servlet>
> * <servlet-name> YourServlet </servlet-name>
> * <servlet-class> your.package.YourServlet
> </servlet-class>
> * <init-param>
> @@ -261,6 +261,17 @@
> * </init-param>
> * </servlet>
> * </pre>
> + *
> + * Alternately, if you wish to configure an entire context in this
> + * fashion, you may use the following:
> + * <br>
> + * <pre>
> + * <context-param>
> + * <param-name> properties </param-name>
> + * <param-value> velocity.properties </param-value>
> + * <description> Path to Velocity configuration
> </description>
> + * </context-param>
> + * </pre>
> *
> * Derived classes may do the same, or take advantage of this code to do
> the loading for them via :
> * <pre>
> @@ -280,6 +291,11 @@
> throws IOException, FileNotFoundException
> {
> String propsFile = config.getInitParameter(INIT_PROPS_KEY);
> + if (propsFile == null || propsFile.length() == 0)
> + {
> + propsFile = config.getServletContext()
> + .getInitParameter(INIT_PROPS_KEY);
> + }
>
> /*
> * This will attempt to find the location of the properties
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
--
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
Java : the speed of Smalltalk with the simple elegance of C++...
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>