velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r1091695 - in /velocity/tools/trunk: ./ maven-velocity-tools-plugin/ velocity-tools-assembly/ velocity-tools-assembly/src/main/assembly/ velocity-tools-examples/displaytag-directive/ velocity-tools-examples/velocity-tools-examples-showcase/...
Date Wed, 13 Apr 2011 08:17:03 GMT
Author: cbrisson
Date: Wed Apr 13 08:17:02 2011
New Revision: 1091695

URL: http://svn.apache.org/viewvc?rev=1091695&view=rev
Log:
support of engine-2.x for the tools in progress

Added:
    velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml.engine-2.x
    velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml.engine-2.x
    velocity/tools/trunk/velocity-tools-generic/pom.xml.engine-2.x
Removed:
    velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/log/CommonsLogLogSystem.java
    velocity/tools/trunk/velocity-tools-view-engine2/
    velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/servlet/ServletLogger.java
Modified:
    velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml
    velocity/tools/trunk/pom.xml
    velocity/tools/trunk/velocity-tools-assembly/pom.xml
    velocity/tools/trunk/velocity-tools-assembly/src/main/assembly/all.xml
    velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml
    velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/demo.vm
    velocity/tools/trunk/velocity-tools-generic/pom.xml
    velocity/tools/trunk/velocity-tools-generic/src/test/java/org/apache/velocity/tools/generic/MockLogChute.java
    velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletLogChute.java
    velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java

Modified: velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml?rev=1091695&r1=1091694&r2=1091695&view=diff
==============================================================================
--- velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml (original)
+++ velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml Wed Apr 13 08:17:02 2011
@@ -99,6 +99,12 @@
             <version>2.0</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity-engine-log4j</artifactId>
+            <version>2.0.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
     <reporting>
         <plugins>
@@ -109,4 +115,4 @@
             </plugin>
         </plugins>
     </reporting>
-</project>
\ No newline at end of file
+</project>

Added: velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml.engine-2.x
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml.engine-2.x?rev=1091695&view=auto
==============================================================================
--- velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml.engine-2.x (added)
+++ velocity/tools/trunk/maven-velocity-tools-plugin/pom.xml.engine-2.x Wed Apr 13 08:17:02
2011
@@ -0,0 +1,118 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>velocity-tools-parent</artifactId>
+        <groupId>org.apache.velocity</groupId>
+        <version>2.1.0-SNAPSHOT</version>
+    </parent>
+    <groupId>org.apache.velocity</groupId>
+    <artifactId>maven-velocity-tools-plugin</artifactId>
+    <name>Apache Velocity Tools - Maven plugin</name>
+    <version>2.1.0-SNAPSHOT</version>
+    <packaging>maven-plugin</packaging>
+    <description>Maven plugin to work with Velocity Tools</description>
+    <profiles>
+        <profile>
+            <id>maven3</id>
+            <activation>
+                <file>
+                    <!-- This employs that the basedir expression is only
+                        recognized by Maven 3.x (see MNG-2363) -->
+                    <exists>${basedir}</exists>
+                </file>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-site-plugin</artifactId>
+                        <version>3.0-beta-3</version>
+                        <configuration>
+                            <inputEncoding>UTF-8</inputEncoding>
+                            <outputEncoding>UTF-8</outputEncoding>
+                            <reportPlugins>
+                                <plugin>
+                                    <groupId>org.apache.maven.plugins</groupId>
+                                    <artifactId>maven-project-info-reports-plugin
+                                    </artifactId>
+                                    <version>2.2</version>
+                                </plugin>
+                                <plugin>
+                                    <groupId>org.apache.maven.plugins</groupId>
+                                    <artifactId>maven-plugin-plugin</artifactId>
+                                    <version>2.6</version>
+                                </plugin>
+                            </reportPlugins>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity-tools-view-jsp</artifactId>
+            <version>2.1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-digester</groupId>
+            <artifactId>commons-digester</artifactId>
+            <version>2.1</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.8.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-plugin-api</artifactId>
+            <version>2.2.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-project</artifactId>
+            <version>2.2.1</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet.jsp</groupId>
+            <artifactId>jsp-api</artifactId>
+            <version>2.1</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.5</version>
+        </dependency>
+        <dependency>
+            <groupId>org.easymock</groupId>
+            <artifactId>easymock</artifactId>
+            <version>3.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity-engine-log4j</artifactId>
+            <version>2.0.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-plugin-plugin</artifactId>
+                <version>2.5.1</version>
+            </plugin>
+        </plugins>
+    </reporting>
+</project>

Modified: velocity/tools/trunk/pom.xml
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/pom.xml?rev=1091695&r1=1091694&r2=1091695&view=diff
==============================================================================
--- velocity/tools/trunk/pom.xml (original)
+++ velocity/tools/trunk/pom.xml Wed Apr 13 08:17:02 2011
@@ -184,7 +184,6 @@
         <module>velocity-tools-xml</module>
         <module>velocity-tools-view</module>
         <module>velocity-tools-view-jsp</module>
-        <module>velocity-tools-view-engine2</module>
         <module>velocity-tools-struts</module>
         <module>velocity-tools-uberjar</module>
         <module>velocity-tools-examples</module>

Modified: velocity/tools/trunk/velocity-tools-assembly/pom.xml
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-assembly/pom.xml?rev=1091695&r1=1091694&r2=1091695&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-assembly/pom.xml (original)
+++ velocity/tools/trunk/velocity-tools-assembly/pom.xml Wed Apr 13 08:17:02 2011
@@ -53,13 +53,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.velocity</groupId>
-            <artifactId>velocity-tools-view-engine2</artifactId>
-            <version>2.1.0-SNAPSHOT</version>
-            <type>jar</type>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.velocity</groupId>
             <artifactId>velocity-tools-xml</artifactId>
             <version>2.1.0-SNAPSHOT</version>
             <type>jar</type>
@@ -181,4 +174,4 @@
             </build>
         </profile>
     </profiles>
-</project>
\ No newline at end of file
+</project>

Modified: velocity/tools/trunk/velocity-tools-assembly/src/main/assembly/all.xml
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-assembly/src/main/assembly/all.xml?rev=1091695&r1=1091694&r2=1091695&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-assembly/src/main/assembly/all.xml (original)
+++ velocity/tools/trunk/velocity-tools-assembly/src/main/assembly/all.xml Wed Apr 13 08:17:02
2011
@@ -99,14 +99,6 @@
             </includes>
         </fileSet>
         <fileSet>
-            <directory>../velocity-tools-view-engine2</directory>
-            <outputDirectory>src/velocity-tools-view-engine2</outputDirectory>
-            <includes>
-                <include>pom.xml</include>
-                <include>src/</include>
-            </includes>
-        </fileSet>
-        <fileSet>
             <directory>../velocity-tools-view-jsp</directory>
             <outputDirectory>src/velocity-tools-view-jsp</outputDirectory>
             <includes>
@@ -191,10 +183,6 @@
             <outputDirectory>docs/velocity-tools-view-jsp</outputDirectory>
         </fileSet>
         <fileSet>
-            <directory>../velocity-tools-view-engine2/target/site</directory>
-            <outputDirectory>docs/velocity-tools-view-engine2</outputDirectory>
-        </fileSet>
-        <fileSet>
             <directory>../velocity-tools-struts/target/site</directory>
             <outputDirectory>docs/velocity-tools-struts</outputDirectory>
         </fileSet>
@@ -223,4 +211,4 @@
             <outputDirectory>docs/velocity-tools-examples/velocity-tools-examples-struts</outputDirectory>
         </fileSet>
     </fileSets>
-</assembly>
\ No newline at end of file
+</assembly>

Modified: velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml?rev=1091695&r1=1091694&r2=1091695&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml (original)
+++ velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml Wed Apr 13 08:17:02
2011
@@ -27,6 +27,11 @@
                         <artifactId>displaytag</artifactId>
                         <version>1.2</version>
                     </dependency>
+                    <dependency>
+        	      <groupId>org.apache.velocity</groupId>
+        	      <artifactId>velocity-engine-log4j</artifactId>
+        	      <version>2.0.0-SNAPSHOT</version>
+                    </dependency>
                 </dependencies>
                 <executions>
                     <execution>
@@ -45,11 +50,13 @@
             <artifactId>displaytag</artifactId>
             <version>1.2</version>
         </dependency>
+<!--
         <dependency>
         	<groupId>org.apache.velocity</groupId>
-        	<artifactId>velocity</artifactId>
-        	<version>1.6</version>
+        	<artifactId>velocity-engine-log4j</artifactId>
+        	<version>2.0.0-SNAPSHOT</version>
         </dependency>
+-->
         <dependency>
         	<groupId>org.apache.velocity</groupId>
         	<artifactId>velocity-tools-view-jsp</artifactId>
@@ -62,4 +69,4 @@
         	<scope>provided</scope>
         </dependency>
     </dependencies>
-</project>
\ No newline at end of file
+</project>

Added: velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml.engine-2.x
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml.engine-2.x?rev=1091695&view=auto
==============================================================================
--- velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml.engine-2.x (added)
+++ velocity/tools/trunk/velocity-tools-examples/displaytag-directive/pom.xml.engine-2.x Wed
Apr 13 08:17:02 2011
@@ -0,0 +1,72 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>velocity-tools-examples</artifactId>
+        <groupId>org.apache.velocity</groupId>
+        <version>2.1.0-SNAPSHOT</version>
+    </parent>
+    <groupId>org.apache.velocity</groupId>
+    <artifactId>displaytag-directive</artifactId>
+    <version>2.1.0-SNAPSHOT</version>
+    <name>Displaytag directives</name>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.velocity</groupId>
+                <artifactId>maven-velocity-tools-plugin</artifactId>
+                <version>2.1.0-SNAPSHOT</version>
+                <configuration>
+                    <packageName>org.apache.velocity.tools.examples.displaytag</packageName>
+                    <prefix>display</prefix>
+                    <tld>META-INF/displaytag.tld</tld>
+                </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>displaytag</groupId>
+                        <artifactId>displaytag</artifactId>
+                        <version>1.2</version>
+                    </dependency>
+                    <dependency>
+        	      <groupId>org.apache.velocity</groupId>
+        	      <artifactId>velocity-engine-log4j</artifactId>
+        	      <version>2.0.0-SNAPSHOT</version>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <id>directive-generation</id>
+                        <goals>
+                            <goal>taglib2directive</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>displaytag</groupId>
+            <artifactId>displaytag</artifactId>
+            <version>1.2</version>
+        </dependency>
+<!--
+        <dependency>
+        	<groupId>org.apache.velocity</groupId>
+        	<artifactId>velocity-engine-log4j</artifactId>
+        	<version>2.0.0-SNAPSHOT</version>
+        </dependency>
+-->
+        <dependency>
+        	<groupId>org.apache.velocity</groupId>
+        	<artifactId>velocity-tools-view-jsp</artifactId>
+        	<version>2.1.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+        	<groupId>javax.servlet.jsp</groupId>
+        	<artifactId>jsp-api</artifactId>
+        	<version>2.1</version>
+        	<scope>provided</scope>
+        </dependency>
+    </dependencies>
+</project>

Modified: velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/demo.vm
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/demo.vm?rev=1091695&r1=1091694&r2=1091695&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/demo.vm
(original)
+++ velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/demo.vm
Wed Apr 13 08:17:02 2011
@@ -32,6 +32,14 @@
 #set( $demo = $text.demo )
 #set( $tool = $class.inspect($toolclass) )
 
+#macro(count)##
+#if($velocityCount)$velocityCount#else$foreach.count#end##
+#end
+
+#macro(setCount)##
+#if($velocityCount)#set($ccount = $velocityCount)#else#set($count = $foreach.count)#end##
+#end
+
 <table border="1" cellspacing="0" cellpadding="3">
 <tr>
   <th>$demo.function</th>
@@ -68,9 +76,9 @@
       ## whose size is inversely proportional to the number of fields
       #set( $fieldsize = $math.sub($math.idiv(24, $method.parameterCount), $method.parameterCount)
)
       #foreach( $param in $method.parameters )
-        #set( $fieldname = "$method.uniqueName$velocityCount" )
+        #set( $fieldname = "$method.uniqueName#count" )
         ## look for a default value
-        #set( $fielddefault = $text.get("${toolname}.${method.uniqueName}.param$velocityCount")
)
+        #set( $fielddefault = $text.get("${toolname}.${method.uniqueName}.param#count") )
         #if( !$fielddefault.exists )
           ## look for a default for this type for this method
           #set( $fielddefault = $text.get("${toolname}.${method.name}.$param.simpleName")
)
@@ -85,7 +93,8 @@
         #end
         ## look for a value in the params, use the default if none is found
         #set( $fieldvalue = $display.alt($params.get($fieldname), $fielddefault) )
-        #if( $velocityCount > 1 ),#end
+        #setCount
+        #if( $count > 1 ),#end
         <input type="text" name="$fieldname" value="$fieldvalue" size="$fieldsize"/>
       #end
       <input type="submit" value="$text.demo.try">
@@ -93,7 +102,7 @@
     ## if we have at least one param value
     #if( $params.get("${method.uniqueName}1") )
       ## do the actual call using the provided param values
-      #set( $call = "${esc.d}${toolname}.${method.name}(#foreach( $param in $method.parameters
)#if( $velocityCount > 1 ), #end$!params.get($render.eval('$method.uniqueName$velocityCount'))#end)"
)
+      #set( $call = "${esc.d}${toolname}.${method.name}(#foreach( $param in $method.parameters
)#setCount#if( $count > 1 ), #end$!params.get($render.eval('$method.uniqueName#count'))#end)"
)
       #set( $result = $call )
       #set( $result = $render.eval($call) )
       <br>

Modified: velocity/tools/trunk/velocity-tools-generic/pom.xml
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/pom.xml?rev=1091695&r1=1091694&r2=1091695&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/pom.xml (original)
+++ velocity/tools/trunk/velocity-tools-generic/pom.xml Wed Apr 13 08:17:02 2011
@@ -12,9 +12,9 @@
   <description>Generic tools that can be used in any context.</description>
   <dependencies>
   	<dependency>
-  		<groupId>org.apache.velocity</groupId>
-  		<artifactId>velocity</artifactId>
-  		<version>1.6</version>
+                <groupId>org.apache.velocity</groupId>
+  		<artifactId>velocity-engine-servlet-logger</artifactId>
+  		<version>2.0.0-SNAPSHOT</version>
   	</dependency>
   	<dependency>
   		<groupId>commons-beanutils</groupId>
@@ -33,4 +33,4 @@
   		<scope>test</scope>
   	</dependency>
   </dependencies>
-</project>
\ No newline at end of file
+</project>

Added: velocity/tools/trunk/velocity-tools-generic/pom.xml.engine-2.x
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/pom.xml.engine-2.x?rev=1091695&view=auto
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/pom.xml.engine-2.x (added)
+++ velocity/tools/trunk/velocity-tools-generic/pom.xml.engine-2.x Wed Apr 13 08:17:02 2011
@@ -0,0 +1,36 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>velocity-tools-parent</artifactId>
+    <groupId>org.apache.velocity</groupId>
+    <version>2.1.0-SNAPSHOT</version>
+  </parent>
+  <groupId>org.apache.velocity</groupId>
+  <artifactId>velocity-tools-generic</artifactId>
+  <version>2.1.0-SNAPSHOT</version>
+  <name>Apache Velocity Tools - Generic tools</name>
+  <description>Generic tools that can be used in any context.</description>
+  <dependencies>
+  	<dependency>
+                <groupId>org.apache.velocity</groupId>
+  		<artifactId>velocity-engine-servlet-logger</artifactId>
+  		<version>2.0.0-SNAPSHOT</version>
+  	</dependency>
+  	<dependency>
+  		<groupId>commons-beanutils</groupId>
+  		<artifactId>commons-beanutils</artifactId>
+  		<version>1.8.3</version>
+  	</dependency>
+  	<dependency>
+  		<groupId>commons-digester</groupId>
+  		<artifactId>commons-digester</artifactId>
+  		<version>1.8.1</version>
+  	</dependency>
+  	<dependency>
+  		<groupId>junit</groupId>
+  		<artifactId>junit</artifactId>
+  		<version>4.8.1</version>
+  		<scope>test</scope>
+  	</dependency>
+  </dependencies>
+</project>

Modified: velocity/tools/trunk/velocity-tools-generic/src/test/java/org/apache/velocity/tools/generic/MockLogChute.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/test/java/org/apache/velocity/tools/generic/MockLogChute.java?rev=1091695&r1=1091694&r2=1091695&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-generic/src/test/java/org/apache/velocity/tools/generic/MockLogChute.java
(original)
+++ velocity/tools/trunk/velocity-tools-generic/src/test/java/org/apache/velocity/tools/generic/MockLogChute.java
Wed Apr 13 08:17:02 2011
@@ -57,10 +57,16 @@ public class MockLogChute extends System
     }
     
     public void init(RuntimeServices rs)
-        throws Exception
     {
-        super.init(rs);
-
+        // this try-catch is here to allow compilation under velocity-engine-1.x & velocity-engine-2.x
+        try
+        {
+            super.init(rs);
+        }
+        catch(Exception e)
+        {
+            throw new RuntimeException(e);
+        }
         String level = rs.getString(TEST_LOGGER_LEVEL);
         if (level != null)
         {

Modified: velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletLogChute.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletLogChute.java?rev=1091695&r1=1091694&r2=1091695&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletLogChute.java
(original)
+++ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletLogChute.java
Wed Apr 13 08:17:02 2011
@@ -68,7 +68,7 @@ public class ServletLogChute implements 
      * @throws IllegalStateException if the ServletContext is not available
      *         in the application attributes under the appropriate key.
      */
-    public void init(RuntimeServices rs) throws Exception
+    public void init(RuntimeServices rs)
     {
         Object obj = rs.getApplicationAttribute(ServletContext.class.getName());
         if (obj == null)

Modified: velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java?rev=1091695&r1=1091694&r2=1091695&view=diff
==============================================================================
--- velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java
(original)
+++ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/WebappUberspector.java
Wed Apr 13 08:17:02 2011
@@ -65,9 +65,17 @@ public class WebappUberspector extends A
      * @throws Exception
      */
     public VelPropertyGet getPropertyGet(Object obj, String identifier, Info i)
-            throws Exception
     {
-        VelPropertyGet ret = super.getPropertyGet(obj,identifier,i);
+        // this try-catch is here to allow compilation under velocity-engine-1.x & velocity-engine-2.x
+        VelPropertyGet ret;
+        try
+        {
+            ret = super.getPropertyGet(obj,identifier,i);
+        }
+        catch(Exception e)
+        {
+            throw new RuntimeException(e);
+        }
         if(ret == null)
         {
             Class claz = obj.getClass();
@@ -116,9 +124,17 @@ public class WebappUberspector extends A
      */
     public VelPropertySet getPropertySet(Object obj, String identifier,
                                          Object arg, Info i)
-            throws Exception
     {
-        VelPropertySet ret = super.getPropertySet(obj,identifier,arg,i);
+        // this try-catch is here to allow compilation under velocity-engine-1.x & velocity-engine-2.x
+        VelPropertySet ret;
+        try
+        {
+           ret = super.getPropertySet(obj,identifier,arg,i);
+        }
+        catch(Exception e)
+        {
+            throw new RuntimeException(e);
+        }
         if(ret == null) {
             Class claz = obj.getClass();
             if(obj instanceof HttpServletRequest



Mime
View raw message