You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by ku...@apache.org on 2023/08/20 10:47:55 UTC
[struts] 02/10: WW-5334 Clean up VelocityStrutsUtil
This is an automated email from the ASF dual-hosted git repository.
kusal pushed a commit to branch WW-5334-velocity-manager
in repository https://gitbox.apache.org/repos/asf/struts.git
commit f4daeb3ea4539e00037b00cb0cb768307132a138
Author: Kusal Kithul-Godage <gi...@kusal.io>
AuthorDate: Thu Aug 17 18:57:58 2023 +1000
WW-5334 Clean up VelocityStrutsUtil
---
.../struts2/views/velocity/VelocityStrutsUtil.java | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/plugins/velocity/src/main/java/org/apache/struts2/views/velocity/VelocityStrutsUtil.java b/plugins/velocity/src/main/java/org/apache/struts2/views/velocity/VelocityStrutsUtil.java
index 853669226..9ecc598d8 100644
--- a/plugins/velocity/src/main/java/org/apache/struts2/views/velocity/VelocityStrutsUtil.java
+++ b/plugins/velocity/src/main/java/org/apache/struts2/views/velocity/VelocityStrutsUtil.java
@@ -18,12 +18,7 @@
*/
package org.apache.struts2.views.velocity;
-import java.io.CharArrayWriter;
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.util.StrutsUtil;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.context.Context;
@@ -31,7 +26,10 @@ import org.apache.velocity.exception.MethodInvocationException;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
-import com.opensymphony.xwork2.util.ValueStack;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.CharArrayWriter;
+import java.io.IOException;
/**
* Struts velocity related util.
@@ -39,8 +37,8 @@ import com.opensymphony.xwork2.util.ValueStack;
*/
public class VelocityStrutsUtil extends StrutsUtil {
- private Context ctx;
- private VelocityEngine velocityEngine;
+ private final Context ctx;
+ private final VelocityEngine velocityEngine;
public VelocityStrutsUtil(VelocityEngine engine, Context ctx, ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack, request, response);