mirror of
https://github.com/apache/struts.git
synced 2026-08-06 15:17:00 +00:00
Injects missing dependency
This commit is contained in:
+9
-2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user