You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2016/03/03 17:39:03 UTC

[1/9] struts git commit: WW-3940 Upgrade to Velocity Tools 2.0

Repository: struts
Updated Branches:
  refs/heads/master 4ea8883ff -> e5d693a8d


WW-3940 Upgrade to Velocity Tools 2.0

JWebUnit upgrade to 3.3 too

Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/aa24c1b6
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/aa24c1b6
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/aa24c1b6

Branch: refs/heads/master
Commit: aa24c1b6aad358e1b9dee05800597f2860b2faae
Parents: c167d6c
Author: Victor Sosa <vi...@gmail.com>
Authored: Wed Jan 20 17:32:12 2016 -0400
Committer: Victor Sosa <vi...@gmail.com>
Committed: Wed Jan 20 17:32:12 2016 -0400

----------------------------------------------------------------------
 apps/portlet/pom.xml                                           | 2 +-
 .../java/org/apache/struts2/portlet/test/BasePortletTest.java  | 6 ++++--
 .../org/apache/struts2/portlet/test/Struts2PortletTest.java    | 2 ++
 .../struts2/components/template/VelocityTemplateEngine.java    | 2 +-
 pom.xml                                                        | 4 ++--
 5 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/aa24c1b6/apps/portlet/pom.xml
----------------------------------------------------------------------
diff --git a/apps/portlet/pom.xml b/apps/portlet/pom.xml
index cbaf4a8..388b9c4 100644
--- a/apps/portlet/pom.xml
+++ b/apps/portlet/pom.xml
@@ -155,7 +155,7 @@
         <dependency>
             <groupId>net.sourceforge.jwebunit</groupId>
             <artifactId>jwebunit-htmlunit-plugin</artifactId>
-            <version>1.4.1</version>
+            <version>3.3</version>
             <scope>test</scope>
             <exclusions>
                 <exclusion>

http://git-wip-us.apache.org/repos/asf/struts/blob/aa24c1b6/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
----------------------------------------------------------------------
diff --git a/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java b/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
index 13f172f..4f63080 100644
--- a/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
+++ b/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
@@ -1,14 +1,16 @@
 package org.apache.struts2.portlet.test;
 
-import net.sourceforge.jwebunit.junit.WebTestCase;
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
 import org.apache.pluto.core.PortletServlet;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.servlet.ServletHolder;
 import org.mortbay.jetty.webapp.WebAppContext;
 
+import junit.framework.TestCase;
+
 import java.io.File;
 
-public abstract class BasePortletTest extends WebTestCase {
+public abstract class BasePortletTest extends TestCase {
 	
 	protected Server server;
 	

http://git-wip-us.apache.org/repos/asf/struts/blob/aa24c1b6/apps/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java
----------------------------------------------------------------------
diff --git a/apps/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java b/apps/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java
index 99583de..8daadf9 100644
--- a/apps/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java
+++ b/apps/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java
@@ -1,5 +1,7 @@
 package org.apache.struts2.portlet.test;
 
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+
 public class Struts2PortletTest extends BasePortletTest {
 	
 	private final static String PORTLET_NAME = "StrutsPortlet";

http://git-wip-us.apache.org/repos/asf/struts/blob/aa24c1b6/core/src/main/java/org/apache/struts2/components/template/VelocityTemplateEngine.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/template/VelocityTemplateEngine.java b/core/src/main/java/org/apache/struts2/components/template/VelocityTemplateEngine.java
index 6e1db53..70b6073 100644
--- a/core/src/main/java/org/apache/struts2/components/template/VelocityTemplateEngine.java
+++ b/core/src/main/java/org/apache/struts2/components/template/VelocityTemplateEngine.java
@@ -74,7 +74,7 @@ public class VelocityTemplateEngine extends BaseTemplateEngine {
                 // try to load, and if it works, stop at the first one
                 template = velocityEngine.getTemplate(templateName);
                 break;
-            } catch (IOException e) {
+            } catch (Exception e) {
                 if (exception == null) {
                     exception = e;
                 }

http://git-wip-us.apache.org/repos/asf/struts/blob/aa24c1b6/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 08c94b4..1d8e279 100644
--- a/pom.xml
+++ b/pom.xml
@@ -515,14 +515,14 @@
             <dependency>
                 <groupId>org.apache.velocity</groupId>
                 <artifactId>velocity</artifactId>
-                <version>1.6.4</version>
+                <version>1.7</version>
                 <optional>true</optional>
             </dependency>
 
             <dependency>
                 <groupId>org.apache.velocity</groupId>
                 <artifactId>velocity-tools</artifactId>
-                <version>1.3</version>
+                <version>2.0</version>
                 <exclusions>
                     <exclusion>
                         <groupId>javax.servlet</groupId>


[3/9] struts git commit: Merge branch 'ww-3940' of git@github.com:victorsosa/struts.git into ww-3940

Posted by lu...@apache.org.
Merge branch 'ww-3940' of git@github.com:victorsosa/struts.git into
ww-3940

Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/8b426cf9
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/8b426cf9
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/8b426cf9

Branch: refs/heads/master
Commit: 8b426cf9bf06304ba80ed8281be8bf4b8969ebef
Parents: 8391071 aa24c1b
Author: Victor Sosa <vi...@gmail.com>
Authored: Wed Jan 20 17:43:43 2016 -0400
Committer: Victor Sosa <vi...@gmail.com>
Committed: Wed Jan 20 17:43:59 2016 -0400

----------------------------------------------------------------------
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/8b426cf9/.gitignore
----------------------------------------------------------------------
diff --cc .gitignore
index bcebcd9,bcebcd9..2aa4207
--- a/.gitignore
+++ b/.gitignore
@@@ -69,3 -69,3 +69,4 @@@ bundles/targe
  plugins/target
  target
  plugins/testng/test-output
++/bin/


[9/9] struts git commit: WW-3940 Upgrades Velocity tools

Posted by lu...@apache.org.
WW-3940 Upgrades Velocity tools


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/e5d693a8
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/e5d693a8
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/e5d693a8

Branch: refs/heads/master
Commit: e5d693a8dfad577fde7066334e89ab9efefcbc2a
Parents: 4ea8883 09d1954
Author: Lukasz Lenart <lu...@apache.org>
Authored: Thu Mar 3 17:38:37 2016 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Thu Mar 3 17:38:37 2016 +0100

----------------------------------------------------------------------
 apps/portlet/pom.xml                            |  2 +-
 .../struts2/portlet/test/BasePortletTest.java   |  6 ++-
 .../portlet/test/Struts2PortletTest.java        |  2 +
 .../template/VelocityTemplateEngine.java        |  2 +-
 .../struts2/result/VelocityResultTest.java      |  4 +-
 .../sitemesh/VelocityDecoratorServlet.java      | 53 +++++++++++++-------
 pom.xml                                         |  4 +-
 7 files changed, 46 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/e5d693a8/pom.xml
----------------------------------------------------------------------


[6/9] struts git commit: ww-3940 change

Posted by lu...@apache.org.
ww-3940 change


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/f4d5305b
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/f4d5305b
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/f4d5305b

Branch: refs/heads/master
Commit: f4d5305b19d186c7780b3f8e0976816a15f7ec7e
Parents: 8d6c3b6 8b426cf
Author: Victor Sosa <vi...@gmail.com>
Authored: Wed Jan 20 18:54:22 2016 -0400
Committer: Victor Sosa <vi...@gmail.com>
Committed: Wed Jan 20 19:41:48 2016 -0400

----------------------------------------------------------------------
 .../java/org/apache/struts2/sitemesh/VelocityDecoratorServlet.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/f4d5305b/plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/VelocityDecoratorServlet.java
----------------------------------------------------------------------
diff --cc plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/VelocityDecoratorServlet.java
index e832b2f,bcbfb72..4b1b088
--- a/plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/VelocityDecoratorServlet.java
+++ b/plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/VelocityDecoratorServlet.java
@@@ -88,14 -78,13 +88,14 @@@ public class VelocityDecoratorServlet e
          velocityManager.init(config.getServletContext());
  
          // do whatever we have to do to init Velocity
 -        setVelocityEngine(velocityManager.getVelocityEngine());
 -        toolboxManager = velocityManager.getToolboxManager();
 +        getVelocityView().setVelocityEngine(velocityManager.getVelocityEngine());
-         //getVelocityView().getToolboxFactory(). toolboxManager = velocityManager.getToolboxManager();
++        // toolboxManager = velocityManager.getToolboxManager();
  
 +        
          // we can get these now that velocity is initialized
 -        defaultContentType = getVelocityProperty(CONTENT_TYPE, DEFAULT_CONTENT_TYPE);
 +        defaultContentType = getVelocityProperty(VelocityView.CONTENT_TYPE_KEY, VelocityView.DEFAULT_CONTENT_TYPE);
  
 -        String encoding = getVelocityProperty(RuntimeConstants.OUTPUT_ENCODING, DEFAULT_OUTPUT_ENCODING);
 +        String encoding = getVelocityProperty(RuntimeConstants.OUTPUT_ENCODING, VelocityView.DEFAULT_OUTPUT_ENCODING);
  
          // For non Latin-1 encodings, ensure that the charset is
          // included in the Content-Type header.


[2/9] struts git commit: WW-3940 Upgrade to Velocity Tools 2.0

Posted by lu...@apache.org.
WW-3940 Upgrade to Velocity Tools 2.0

JWebUnit upgrade to 3.3 too

Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/83910714
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/83910714
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/83910714

Branch: refs/heads/master
Commit: 83910714e874aebea10806d6a4c65bdd51d65d2d
Parents: c167d6c
Author: Victor Sosa <vi...@gmail.com>
Authored: Wed Jan 20 17:32:12 2016 -0400
Committer: Victor Sosa <vi...@gmail.com>
Committed: Wed Jan 20 17:42:54 2016 -0400

----------------------------------------------------------------------
 apps/portlet/pom.xml                                           | 2 +-
 .../java/org/apache/struts2/portlet/test/BasePortletTest.java  | 6 ++++--
 .../org/apache/struts2/portlet/test/Struts2PortletTest.java    | 2 ++
 .../struts2/components/template/VelocityTemplateEngine.java    | 2 +-
 .../java/org/apache/struts2/result/VelocityResultTest.java     | 4 ++--
 pom.xml                                                        | 4 ++--
 6 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/83910714/apps/portlet/pom.xml
----------------------------------------------------------------------
diff --git a/apps/portlet/pom.xml b/apps/portlet/pom.xml
index cbaf4a8..388b9c4 100644
--- a/apps/portlet/pom.xml
+++ b/apps/portlet/pom.xml
@@ -155,7 +155,7 @@
         <dependency>
             <groupId>net.sourceforge.jwebunit</groupId>
             <artifactId>jwebunit-htmlunit-plugin</artifactId>
-            <version>1.4.1</version>
+            <version>3.3</version>
             <scope>test</scope>
             <exclusions>
                 <exclusion>

http://git-wip-us.apache.org/repos/asf/struts/blob/83910714/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
----------------------------------------------------------------------
diff --git a/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java b/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
index 13f172f..4f63080 100644
--- a/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
+++ b/apps/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
@@ -1,14 +1,16 @@
 package org.apache.struts2.portlet.test;
 
-import net.sourceforge.jwebunit.junit.WebTestCase;
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
 import org.apache.pluto.core.PortletServlet;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.servlet.ServletHolder;
 import org.mortbay.jetty.webapp.WebAppContext;
 
+import junit.framework.TestCase;
+
 import java.io.File;
 
-public abstract class BasePortletTest extends WebTestCase {
+public abstract class BasePortletTest extends TestCase {
 	
 	protected Server server;
 	

http://git-wip-us.apache.org/repos/asf/struts/blob/83910714/apps/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java
----------------------------------------------------------------------
diff --git a/apps/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java b/apps/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java
index 99583de..8daadf9 100644
--- a/apps/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java
+++ b/apps/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java
@@ -1,5 +1,7 @@
 package org.apache.struts2.portlet.test;
 
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+
 public class Struts2PortletTest extends BasePortletTest {
 	
 	private final static String PORTLET_NAME = "StrutsPortlet";

http://git-wip-us.apache.org/repos/asf/struts/blob/83910714/core/src/main/java/org/apache/struts2/components/template/VelocityTemplateEngine.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/template/VelocityTemplateEngine.java b/core/src/main/java/org/apache/struts2/components/template/VelocityTemplateEngine.java
index 6e1db53..70b6073 100644
--- a/core/src/main/java/org/apache/struts2/components/template/VelocityTemplateEngine.java
+++ b/core/src/main/java/org/apache/struts2/components/template/VelocityTemplateEngine.java
@@ -74,7 +74,7 @@ public class VelocityTemplateEngine extends BaseTemplateEngine {
                 // try to load, and if it works, stop at the first one
                 template = velocityEngine.getTemplate(templateName);
                 break;
-            } catch (IOException e) {
+            } catch (Exception e) {
                 if (exception == null) {
                     exception = e;
                 }

http://git-wip-us.apache.org/repos/asf/struts/blob/83910714/core/src/test/java/org/apache/struts2/result/VelocityResultTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/result/VelocityResultTest.java b/core/src/test/java/org/apache/struts2/result/VelocityResultTest.java
index 0a945ec..18806cc 100644
--- a/core/src/test/java/org/apache/struts2/result/VelocityResultTest.java
+++ b/core/src/test/java/org/apache/struts2/result/VelocityResultTest.java
@@ -134,13 +134,13 @@ public class VelocityResultTest extends StrutsInternalTestCase {
     class TestVelocityEngine extends VelocityEngine {
         public String templateName;
 
-        public Template getTemplate(String templateName) throws ResourceNotFoundException, ParseErrorException, Exception {
+        public Template getTemplate(String templateName) throws ResourceNotFoundException, ParseErrorException {
             this.templateName = templateName;
 
             return new Template();
         }
 
-        public Template getTemplate(String templateName, String charSet) throws ResourceNotFoundException, ParseErrorException, Exception {
+        public Template getTemplate(String templateName, String charSet) throws ResourceNotFoundException, ParseErrorException {
             this.templateName = templateName;
 
             return new Template();

http://git-wip-us.apache.org/repos/asf/struts/blob/83910714/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 08c94b4..1d8e279 100644
--- a/pom.xml
+++ b/pom.xml
@@ -515,14 +515,14 @@
             <dependency>
                 <groupId>org.apache.velocity</groupId>
                 <artifactId>velocity</artifactId>
-                <version>1.6.4</version>
+                <version>1.7</version>
                 <optional>true</optional>
             </dependency>
 
             <dependency>
                 <groupId>org.apache.velocity</groupId>
                 <artifactId>velocity-tools</artifactId>
-                <version>1.3</version>
+                <version>2.0</version>
                 <exclusions>
                     <exclusion>
                         <groupId>javax.servlet</groupId>


[7/9] struts git commit: Merge branch 'ww-3940' of git@github.com:victorsosa/struts.git into ww-3940

Posted by lu...@apache.org.
Merge branch 'ww-3940' of git@github.com:victorsosa/struts.git into ww-3940

Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/8232d931
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/8232d931
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/8232d931

Branch: refs/heads/master
Commit: 8232d931d925aeae4e849f087c879e99c135686f
Parents: f4d5305 9fa2ec6
Author: Victor Sosa <vi...@gmail.com>
Authored: Wed Jan 20 19:42:03 2016 -0400
Committer: Victor Sosa <vi...@gmail.com>
Committed: Wed Jan 20 19:42:03 2016 -0400

----------------------------------------------------------------------

----------------------------------------------------------------------



[5/9] struts git commit: Merge branch 'ww-3940' of github.com:victorsosa/struts into ww-3940

Posted by lu...@apache.org.
Merge branch 'ww-3940' of github.com:victorsosa/struts into ww-3940


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/9fa2ec61
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/9fa2ec61
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/9fa2ec61

Branch: refs/heads/master
Commit: 9fa2ec610e9fe362f3fa582824c011154185b8ea
Parents: 8d6c3b6 8b426cf
Author: Victor Sosa <vi...@gmail.com>
Authored: Wed Jan 20 18:54:22 2016 -0400
Committer: Victor Sosa <vi...@gmail.com>
Committed: Wed Jan 20 18:54:22 2016 -0400

----------------------------------------------------------------------

----------------------------------------------------------------------



[4/9] struts git commit: Merge branch 'ww-3940' of git@github.com:victorsosa/struts.git into ww-3940

Posted by lu...@apache.org.
Merge branch 'ww-3940' of git@github.com:victorsosa/struts.git into
ww-3940

Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/8d6c3b6b
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/8d6c3b6b
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/8d6c3b6b

Branch: refs/heads/master
Commit: 8d6c3b6b8bb5cfe48ea6496ba9f65ced5815f863
Parents: 8391071 aa24c1b
Author: Victor Sosa <vi...@gmail.com>
Authored: Wed Jan 20 17:43:43 2016 -0400
Committer: Victor Sosa <vi...@gmail.com>
Committed: Wed Jan 20 18:51:49 2016 -0400

----------------------------------------------------------------------
 .gitignore                                      |  1 +
 .../sitemesh/VelocityDecoratorServlet.java      | 53 +++++++++++++-------
 2 files changed, 35 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/8d6c3b6b/.gitignore
----------------------------------------------------------------------
diff --cc .gitignore
index bcebcd9,bcebcd9..2aa4207
--- a/.gitignore
+++ b/.gitignore
@@@ -69,3 -69,3 +69,4 @@@ bundles/targe
  plugins/target
  target
  plugins/testng/test-output
++/bin/

http://git-wip-us.apache.org/repos/asf/struts/blob/8d6c3b6b/plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/VelocityDecoratorServlet.java
----------------------------------------------------------------------
diff --cc plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/VelocityDecoratorServlet.java
index bcbfb72,bcbfb72..e832b2f
--- a/plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/VelocityDecoratorServlet.java
+++ b/plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/VelocityDecoratorServlet.java
@@@ -28,6 -28,6 +28,9 @@@ package org.apache.struts2.sitemesh
  import com.opensymphony.module.sitemesh.*;
  import com.opensymphony.module.sitemesh.util.OutputConverter;
  import com.opensymphony.xwork2.ActionContext;
++
++import org.apache.logging.log4j.LogManager;
++import org.apache.logging.log4j.Logger;
  import org.apache.struts2.ServletActionContext;
  import org.apache.struts2.StrutsStatics;
  import org.apache.struts2.dispatcher.Dispatcher;
@@@ -36,12 -36,12 +39,15 @@@ import org.apache.struts2.views.velocit
  import org.apache.velocity.Template;
  import org.apache.velocity.context.Context;
  import org.apache.velocity.runtime.RuntimeConstants;
--import org.apache.velocity.tools.view.servlet.VelocityViewServlet;
++import org.apache.velocity.tools.view.VelocityView;
++import org.apache.velocity.tools.view.VelocityViewServlet;
  
  import javax.servlet.ServletConfig;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
++
++import java.io.IOException;
  import java.io.StringWriter;
  
  /**
@@@ -53,6 -53,6 +59,10 @@@
   */
  public class VelocityDecoratorServlet extends VelocityViewServlet {
  
++    private static final Logger LOG = LogManager.getLogger(VelocityDecoratorServlet.class);
++            
++    private static final long serialVersionUID = -6731485159371716918L;
++    
      protected VelocityManager velocityManager;
      protected String defaultContentType;
  
@@@ -78,17 -78,17 +88,18 @@@
          velocityManager.init(config.getServletContext());
  
          // do whatever we have to do to init Velocity
--        setVelocityEngine(velocityManager.getVelocityEngine());
--        toolboxManager = velocityManager.getToolboxManager();
++        getVelocityView().setVelocityEngine(velocityManager.getVelocityEngine());
++        //getVelocityView().getToolboxFactory(). toolboxManager = velocityManager.getToolboxManager();
  
++        
          // we can get these now that velocity is initialized
--        defaultContentType = getVelocityProperty(CONTENT_TYPE, DEFAULT_CONTENT_TYPE);
++        defaultContentType = getVelocityProperty(VelocityView.CONTENT_TYPE_KEY, VelocityView.DEFAULT_CONTENT_TYPE);
  
--        String encoding = getVelocityProperty(RuntimeConstants.OUTPUT_ENCODING, DEFAULT_OUTPUT_ENCODING);
++        String encoding = getVelocityProperty(RuntimeConstants.OUTPUT_ENCODING, VelocityView.DEFAULT_OUTPUT_ENCODING);
  
          // For non Latin-1 encodings, ensure that the charset is
          // included in the Content-Type header.
--        if (!DEFAULT_OUTPUT_ENCODING.equalsIgnoreCase(encoding)) {
++        if (!VelocityView.DEFAULT_OUTPUT_ENCODING.equalsIgnoreCase(encoding)) {
              int index = defaultContentType.lastIndexOf("charset");
              if (index < 0) {
                  // the charset specifier is not yet present in header.
@@@ -96,14 -96,14 +107,14 @@@
                  defaultContentType += "; charset=" + encoding;
              } else {
                  // The user may have configuration issues.
--                getVelocityEngine().warn("VelocityViewServlet: Charset was already " + "specified in the Content-Type property.  " + "Output encoding property will be ignored.");
++                getVelocityView().getVelocityEngine().getLog().warn("VelocityViewServlet: Charset was already " + "specified in the Content-Type property.  " + "Output encoding property will be ignored.");
              }
          }
  
--        getVelocityEngine().info("VelocityViewServlet: Default content-type is: " + defaultContentType);
++        getVelocityView().getVelocityEngine().getLog().info("VelocityViewServlet: Default content-type is: " + defaultContentType);
      }
  
--    public Template handleRequest(HttpServletRequest request, HttpServletResponse response, Context context) throws Exception {
++    public Template handleRequest(HttpServletRequest request, HttpServletResponse response, Context context) {
          HTMLPage htmlPage = (HTMLPage) request.getAttribute(RequestConstants.PAGE);
          String template;
  
@@@ -119,16 -119,16 +130,20 @@@
              context.put("head", "<!-- head -->");
              template = request.getServletPath();
          } else {
--            context.put("title", OutputConverter.convert(htmlPage.getTitle()));
--            {
--                StringWriter buffer = new StringWriter();
--                htmlPage.writeBody(OutputConverter.getWriter(buffer));
--                context.put("body", buffer.toString());
--            }
--            {
--                StringWriter buffer = new StringWriter();
--                htmlPage.writeHead(OutputConverter.getWriter(buffer));
--                context.put("head", buffer.toString());
++            try {
++                context.put("title", OutputConverter.convert(htmlPage.getTitle()));
++                {
++                    StringWriter buffer = new StringWriter();
++                    htmlPage.writeBody(OutputConverter.getWriter(buffer));
++                    context.put("body", buffer.toString());
++                }
++                {
++                    StringWriter buffer = new StringWriter();
++                    htmlPage.writeHead(OutputConverter.getWriter(buffer));
++                    context.put("head", buffer.toString());
++                }
++            } catch (IOException e) {
++                LOG.error("IOException handle request template", e);
              }
              context.put("page", htmlPage);
              DecoratorMapper decoratorMapper = getDecoratorMapper();


[8/9] struts git commit: Update .gitignore

Posted by lu...@apache.org.
Update .gitignore

Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/09d1954b
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/09d1954b
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/09d1954b

Branch: refs/heads/master
Commit: 09d1954b0c6781a3c40cd3ce2bf8df2bdef7b98d
Parents: 8232d93
Author: victor sosa <vi...@users.noreply.github.com>
Authored: Wed Jan 20 21:09:37 2016 -0400
Committer: victor sosa <vi...@users.noreply.github.com>
Committed: Wed Jan 20 21:09:37 2016 -0400

----------------------------------------------------------------------
 .gitignore | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/09d1954b/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 2aa4207..bcebcd9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -69,4 +69,3 @@ bundles/target
 plugins/target
 target
 plugins/testng/test-output
-/bin/