useSpringBeanBinding flag

This commit is contained in:
Keith Donald
2008-07-10 08:45:21 +00:00
parent bf7458ab45
commit d05d4446ec
3 changed files with 34 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
#Wed Aug 15 08:35:17 EDT 2007
#Thu Jul 10 09:39:53 BST 2008
eclipse.preferences.version=1
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
@@ -9,22 +9,22 @@ org.eclipse.jdt.core.codeComplete.localSuffixes=
org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.3
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.3
org.eclipse.jdt.core.compiler.compliance=1.4
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning

View File

@@ -1,9 +1,8 @@
#Wed Aug 15 08:39:01 EDT 2007
#Thu Jul 10 09:39:53 BST 2008
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_Spring Java Conventions
formatter_settings_version=11
internal.default.compliance=user
org.eclipse.jdt.ui.exception.name=e
org.eclipse.jdt.ui.gettersetter.use.is=false
org.eclipse.jdt.ui.javadoc=false

View File

@@ -17,9 +17,11 @@ package org.springframework.webflow.mvc.builder;
import java.util.List;
import org.springframework.beans.BeanWrapper;
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.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.web.servlet.View;
@@ -55,6 +57,8 @@ public class MvcViewFactoryCreator implements ViewFactoryCreator, ApplicationCon
private FlowViewResolver flowViewResolver = new FlowResourceFlowViewResolver();
private boolean useSpringBeanBinding;
/**
* Create a new Spring MVC View Factory Creator.
* @see #setDefaultViewSuffix(String)
@@ -110,12 +114,36 @@ public class MvcViewFactoryCreator implements ViewFactoryCreator, ApplicationCon
this.flowViewResolver = flowViewResolver;
}
/**
* Whether data binding with Spring's {@link BeanWrapper} should be enabled. Default is false. With this enabled,
* the same binding system used by Spring MVC 2.x is also used in a Web Flow environment.
* @return the use Spring bean binding flag
*/
public boolean getUseSpringBeanBinding() {
return useSpringBeanBinding;
}
/**
* Sets whether to use data binding with Spring's {@link BeanWrapper} should be enabled. Set to 'true' to enable.
* 'false', disabled, is the default. With this enabled, the same binding system used by Spring MVC 2.x is also used
* in a Web Flow environment.
* @param useSpringBeanBinding the Spring bean binding flag
*/
public void setUseSpringBeanBinding(boolean useSpringBeanBinding) {
this.useSpringBeanBinding = useSpringBeanBinding;
}
// implementing ApplicationContextAware
public void setApplicationContext(ApplicationContext applicationContext) {
environment = MvcEnvironment.environmentFor(applicationContext);
}
public ViewFactory createViewFactory(Expression viewId, ExpressionParser expressionParser,
ConversionService conversionService) {
if (useSpringBeanBinding) {
expressionParser = new BeanWrapperExpressionParser(conversionService);
}
if (environment == MvcEnvironment.SERVLET) {
return new ServletMvcViewFactory(viewId, flowViewResolver, expressionParser, conversionService);
} else if (environment == MvcEnvironment.PORTLET) {