Add support for partial JSR-303 bean validation
This change makes it possible to use validation hints in conjunction with declarative, JSR-303 validation. Such hints may be defined in an attribute of the view state where the view state id itself is also interpeted as a hint. A custom ValidationHintResolver can be plugged in if necessary. Issue: SWF-1453
This commit is contained in:
@@ -24,6 +24,7 @@ import org.springframework.validation.Validator;
|
||||
import org.springframework.webflow.engine.builder.BinderConfiguration;
|
||||
import org.springframework.webflow.engine.builder.ViewFactoryCreator;
|
||||
import org.springframework.webflow.execution.ViewFactory;
|
||||
import org.springframework.webflow.validation.ValidationHintResolver;
|
||||
|
||||
/**
|
||||
* A {@link ViewFactoryCreator} implementation for creating instances of a JSF-specific {@link ViewFactory}.
|
||||
@@ -37,7 +38,8 @@ public class JsfViewFactoryCreator implements ViewFactoryCreator {
|
||||
private Lifecycle lifecycle;
|
||||
|
||||
public ViewFactory createViewFactory(Expression viewIdExpression, ExpressionParser expressionParser,
|
||||
ConversionService conversionService, BinderConfiguration binderConfiguration, Validator validator) {
|
||||
ConversionService conversionService, BinderConfiguration binderConfiguration,
|
||||
Validator validator, ValidationHintResolver resolver) {
|
||||
return new JsfViewFactory(viewIdExpression, getLifecycle());
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.springframework.webflow.engine.builder.ViewFactoryCreator;
|
||||
import org.springframework.webflow.engine.builder.support.FlowBuilderServices;
|
||||
import org.springframework.webflow.execution.ViewFactory;
|
||||
import org.springframework.webflow.expression.spel.WebFlowSpringELExpressionParser;
|
||||
import org.springframework.webflow.validation.ValidationHintResolver;
|
||||
|
||||
public class FacesFlowBuilderServicesBeanDefinitionParserTests extends TestCase {
|
||||
|
||||
@@ -77,7 +78,8 @@ public class FacesFlowBuilderServicesBeanDefinitionParserTests extends TestCase
|
||||
public static class TestViewFactoryCreator implements ViewFactoryCreator {
|
||||
|
||||
public ViewFactory createViewFactory(Expression viewIdExpression, ExpressionParser expressionParser,
|
||||
ConversionService conversionService, BinderConfiguration binderConfiguration, Validator validator) {
|
||||
ConversionService conversionService, BinderConfiguration binderConfiguration,
|
||||
Validator validator, ValidationHintResolver validationHintResolver) {
|
||||
throw new UnsupportedOperationException("Auto-generated method stub");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user