Skip to content

Commit

Permalink
Injects missing dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszlenart committed Mar 13, 2017
1 parent 6d60064 commit 8852e3d
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
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;
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -170,7 +177,7 @@ protected void performOValValidation(Object action, ValueStack valueStack, Strin

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();
Expand Down

0 comments on commit 8852e3d

Please sign in to comment.