velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r673876 - in /velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view: JeeConfig.java VelocityView.java
Date Fri, 04 Jul 2008 00:01:15 GMT
Author: nbubna
Date: Thu Jul  3 17:01:15 2008
New Revision: 673876

URL: http://svn.apache.org/viewvc?rev=673876&view=rev
Log:
move findInitParameter impl to JeeConfig

Modified:
    velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/JeeConfig.java
    velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/VelocityView.java

Modified: velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/JeeConfig.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/JeeConfig.java?rev=673876&r1=673875&r2=673876&view=diff
==============================================================================
--- velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/JeeConfig.java (original)
+++ velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/JeeConfig.java Thu Jul
 3 17:01:15 2008
@@ -89,6 +89,22 @@
         return null;
     }
 
+    /**
+     * Looks for the specified init-param in the servlet/filter config
+     * (i.e. calls {@link #getInitParameter}). If no such init-param is
+     * found there, it checks the {@link ServletContext}'s init-params
+     * for the specified parameter.
+     */
+    public String findInitParameter(String key)
+    {
+        String param = getInitParameter(key);
+        if (param == null)
+        {
+            param = getServletContext().getInitParameter(key);
+        }
+        return param;
+    }
+
     public Enumeration getInitParameterNames()
     {
         if (filter != null)

Modified: velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/VelocityView.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/VelocityView.java?rev=673876&r1=673875&r2=673876&view=diff
==============================================================================
--- velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/VelocityView.java (original)
+++ velocity/tools/trunk/src/main/java/org/apache/velocity/tools/view/VelocityView.java Thu
Jul  3 17:01:15 2008
@@ -399,12 +399,7 @@
 
     protected String findInitParameter(String key, JeeConfig config)
     {
-        String param = config.getInitParameter(key);
-        if (param == null)
-        {
-            param = config.getServletContext().getInitParameter(key);
-        }
-        return param;
+        return config.findInitParameter(key);
     }
 
 



Mime
View raw message