Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update to demonstrate fix for SWF-1566

commit f3bd01adad6dddcb9062497889a635c98aaffdaf 1 parent c062dca
@rstoyanchev rstoyanchev authored
View
34 SWF-1566/src/main/java/foo/bar/CustomMvcViewFactoryCreator.java
@@ -0,0 +1,34 @@
+package foo.bar;
+
+import org.springframework.binding.convert.ConversionService;
+import org.springframework.binding.expression.Expression;
+import org.springframework.binding.expression.ExpressionParser;
+import org.springframework.binding.expression.beanwrapper.BeanWrapperExpressionParser;
+import org.springframework.validation.Validator;
+import org.springframework.webflow.engine.builder.BinderConfiguration;
+import org.springframework.webflow.execution.ViewFactory;
+import org.springframework.webflow.mvc.builder.MvcViewFactoryCreator;
+import org.springframework.webflow.validation.ValidationHintResolver;
+
+public class CustomMvcViewFactoryCreator extends MvcViewFactoryCreator {
+
+ @Override
+ public ViewFactory createViewFactory(Expression viewId,
+ ExpressionParser expressionParser,
+ ConversionService conversionService,
+ BinderConfiguration binderConfiguration, Validator validator,
+ ValidationHintResolver validationHintResolver) {
+
+ BeanWrapperExpressionParser bwExpressionParser = new BeanWrapperExpressionParser(conversionService);
+ bwExpressionParser.setAutoGrowNestedPaths(true);
+ bwExpressionParser.setAutoGrowCollectionLimit(1000);
+
+ return super.createViewFactory(viewId, bwExpressionParser, conversionService,
+ binderConfiguration, validator, validationHintResolver);
+ }
+
+
+
+
+
+}
View
32 SWF-1566/src/main/webapp/WEB-INF/spring/webflow.xml
@@ -17,38 +17,12 @@
</webflow:flow-registry>
<!-- Plugs in a custom creator for Web Flow views -->
- <webflow:flow-builder-services id="flowBuilderServices" development="true" validator="validator" expression-parser="webflowExpressionParser"/>
-
- <bean id="expressionParser" class="org.springframework.expression.spel.standard.SpelExpressionParser">
- <constructor-arg name="configuration">
- <bean class="org.springframework.expression.spel.SpelParserConfiguration">
- <constructor-arg name="autoGrowCollections" value="true" />
- <constructor-arg name="autoGrowNullReferences" value="true" />
- </bean>
- </constructor-arg>
- </bean>
+ <webflow:flow-builder-services id="flowBuilderServices" development="true" validator="validator"
+ view-factory-creator="viewFactoryCreator"/>
- <bean id="webflowExpressionParser" class="org.springframework.webflow.expression.spel.WebFlowSpringELExpressionParser">
- <constructor-arg name="expressionParser" ref="expressionParser" />
- </bean>
-
+ <bean id="viewFactoryCreator" class="foo.bar.CustomMvcViewFactoryCreator" />
<!-- Bootstraps JSR-303 validation and exposes it through Spring's Validator interface -->
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/>
- <!-- Apache Tiles:
- Also reference it from <webflow:flow-builder-services> above
-
- <bean id="mvcViewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">
- <property name="viewResolvers" ref="tilesViewResolver"/>
- <property name="useSpringBeanBinding" value="true" />
- </bean>
- -->
-
- <!-- Spring Security:
- Also add it as a listener as a sub-element of <webflow:flow-executor> above
-
- <bean id="securityFlowExecutionListener" class="org.springframework.webflow.security.SecurityFlowExecutionListener" />
- -->
-
</beans>
Please sign in to comment.
Something went wrong with that request. Please try again.