struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [17/17] struts git commit: Injects missing dependency
Date Mon, 13 Mar 2017 17:46:26 GMT
Injects missing dependency


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

Branch: refs/heads/master
Commit: 8852e3d1183f1ce18dbf8dc9bb1da465eaa9f1c3
Parents: 6d60064
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Mon Mar 13 06:56:07 2017 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Mon Mar 13 06:56:07 2017 +0100

----------------------------------------------------------------------
 .../oval/interceptor/OValValidationInterceptor.java      | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/8852e3d1/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/OValValidationInterceptor.java
----------------------------------------------------------------------
diff --git a/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/OValValidationInterceptor.java
b/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/OValValidationInterceptor.java
index 6465020..473c9a7 100644
--- a/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/OValValidationInterceptor.java
+++ b/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/OValValidationInterceptor.java
@@ -23,6 +23,7 @@ package org.apache.struts2.oval.interceptor;
 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.ActionProxy;
 import com.opensymphony.xwork2.ModelDriven;
+import com.opensymphony.xwork2.TextProviderFactory;
 import com.opensymphony.xwork2.Validateable;
 import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
@@ -57,13 +58,19 @@ public class OValValidationInterceptor extends MethodFilterInterceptor
{
     protected boolean alwaysInvokeValidate = true;
     protected boolean programmatic = true;
     protected OValValidationManager validationManager;
-    private boolean validateJPAAnnotations;
+    protected boolean validateJPAAnnotations;
+    protected TextProviderFactory textProviderFactory;
 
     @Inject
     public void setValidationManager(OValValidationManager validationManager) {
         this.validationManager = validationManager;
     }
 
+    @Inject
+    public void setTextProviderFactory(TextProviderFactory textProviderFactory) {
+        this.textProviderFactory = textProviderFactory;
+    }
+
     /**
      * Enable OVal support for JPA
      */
@@ -170,7 +177,7 @@ public class OValValidationInterceptor extends MethodFilterInterceptor
{
 
 	private void addValidationErrors(ConstraintViolation[] violations, Object action, ValueStack
valueStack, String parentFieldname) {
 		if (violations != null) {
-            ValidatorContext validatorContext = new DelegatingValidatorContext(action);
+            ValidatorContext validatorContext = new DelegatingValidatorContext(action, textProviderFactory);
             for (ConstraintViolation violation : violations) {
                 //translate message
                 String key = violation.getMessage();


Mime
View raw message