diff --git a/spring-binding/.classpath b/spring-binding/.classpath
index 40e0e526..c8b8a09e 100644
--- a/spring-binding/.classpath
+++ b/spring-binding/.classpath
@@ -8,7 +8,7 @@
-
+
diff --git a/spring-binding/src/main/java/org/springframework/binding/expression/el/DefaultExpressionFactoryUtils.java b/spring-binding/src/main/java/org/springframework/binding/expression/el/DefaultExpressionFactoryUtils.java
new file mode 100644
index 00000000..73616493
--- /dev/null
+++ b/spring-binding/src/main/java/org/springframework/binding/expression/el/DefaultExpressionFactoryUtils.java
@@ -0,0 +1,74 @@
+package org.springframework.binding.expression.el;
+
+import javax.el.ExpressionFactory;
+
+import org.springframework.beans.BeanInstantiationException;
+import org.springframework.beans.BeanUtils;
+import org.springframework.util.ClassUtils;
+import org.springframework.util.ReflectionUtils;
+
+/**
+ * A helper for creating a new expression factory instance using the default expression factory class configured for the
+ * VM.
+ *
+ * @author Keith Donald
+ */
+public class DefaultExpressionFactoryUtils {
+ private static final String EXPRESSION_FACTORY_PROPERTY = "javax.el.ExpressionFactory";
+
+ static {
+ if (!System.getProperties().containsKey(EXPRESSION_FACTORY_PROPERTY)) {
+ // TODO - change default to Spring EL when it becomes available
+ setDefaultExpressionFactoryClassName("org.jboss.el.ExpressionFactoryImpl");
+ }
+ }
+
+ /**
+ * Returns the type of ExpressionFactory configured for this VM.
+ */
+ public static String getDefaultExpressionFactoryClassName() {
+ return System.getProperty(EXPRESSION_FACTORY_PROPERTY);
+ }
+
+ /**
+ * Sets the type of ExpressionFactory configured for this VM.
+ */
+ public static void setDefaultExpressionFactoryClassName(String expressionFactoryClassName) {
+ System.setProperty(EXPRESSION_FACTORY_PROPERTY, expressionFactoryClassName);
+ }
+
+ /**
+ * Creates a new instance of the expression factory configured for this VM.
+ * @throws IllegalStateException if the ExpressionFactory class cannot be found
+ * @throws RuntimeException if the ExpressionFactory cannot be instantiated
+ */
+ public static ExpressionFactory createExpressionFactory() throws IllegalStateException, RuntimeException {
+ if (ReflectionUtils.findMethod(ExpressionFactory.class, "newInstance") != null) {
+ return ExpressionFactory.newInstance();
+ } else {
+ // Fallback in the case of using an older version of the EL API
+ try {
+ Class expressionFactoryClass = ClassUtils.forName(getDefaultExpressionFactoryClassName());
+ return (ExpressionFactory) BeanUtils.instantiateClass(expressionFactoryClass);
+ } catch (ClassNotFoundException e) {
+ throw new IllegalStateException(
+ "The default ExpressionFactory class '"
+ + getDefaultExpressionFactoryClassName()
+ + "' could not be found in the classpath. "
+ + "Please add this to your classpath or set the default ExpressionFactory class name to something that is in the classpath.",
+ e);
+ } catch (NoClassDefFoundError e) {
+ throw new IllegalStateException(
+ "The default ExpressionFactory class '"
+ + getDefaultExpressionFactoryClassName()
+ + "' could not be found in the classpath. "
+ + "Please add this to your classpath or set the default ExpressionFactory class name to something that is in the classpath.",
+ e);
+ } catch (BeanInstantiationException e) {
+ throw new RuntimeException("An instance of the default ExpressionFactory '"
+ + getDefaultExpressionFactoryClassName()
+ + "' could not be instantiated. Check your EL implementation configuration.", e);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/spring-faces/src/main/java/org/springframework/faces/config/FacesConfigNamespaceHandler.java b/spring-faces/src/main/java/org/springframework/faces/config/FacesConfigNamespaceHandler.java
index 5390f3a5..150fc95d 100644
--- a/spring-faces/src/main/java/org/springframework/faces/config/FacesConfigNamespaceHandler.java
+++ b/spring-faces/src/main/java/org/springframework/faces/config/FacesConfigNamespaceHandler.java
@@ -1,11 +1,28 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.config;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+/**
+ * Namespace handler for the faces namespace.
+ * @author Jeremy Grelle
+ */
public class FacesConfigNamespaceHandler extends NamespaceHandlerSupport {
-
public void init() {
registerBeanDefinitionParser("flow-builder-services", new FacesFlowBuilderServicesBeanDefinitionParser());
}
-
}
diff --git a/spring-faces/src/main/java/org/springframework/faces/config/FacesFlowBuilderServicesBeanDefinitionParser.java b/spring-faces/src/main/java/org/springframework/faces/config/FacesFlowBuilderServicesBeanDefinitionParser.java
index 82ab2d86..5644baa5 100644
--- a/spring-faces/src/main/java/org/springframework/faces/config/FacesFlowBuilderServicesBeanDefinitionParser.java
+++ b/spring-faces/src/main/java/org/springframework/faces/config/FacesFlowBuilderServicesBeanDefinitionParser.java
@@ -1,8 +1,24 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.config;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
+import org.springframework.binding.expression.el.DefaultExpressionFactoryUtils;
import org.springframework.faces.expression.LegacyJSFELExpressionParser;
import org.springframework.faces.model.converter.FacesConversionService;
import org.springframework.faces.webflow.JsfViewFactoryCreator;
@@ -11,6 +27,9 @@ import org.springframework.webflow.engine.builder.support.FlowBuilderServices;
import org.springframework.webflow.expression.el.WebFlowELExpressionParser;
import org.w3c.dom.Element;
+/**
+ * Parser for the flow-builder-services tag.
+ */
public class FacesFlowBuilderServicesBeanDefinitionParser extends AbstractSingleBeanDefinitionParser implements
BeanDefinitionParser {
@@ -34,7 +53,10 @@ public class FacesFlowBuilderServicesBeanDefinitionParser extends AbstractSingle
protected void doParse(Element element, BeanDefinitionBuilder definitionBuilder) {
boolean enableManagedBeans = parseEnableManagedBeans(element, definitionBuilder);
- if (!enableManagedBeans) {
+ if (enableManagedBeans) {
+ definitionBuilder.addPropertyValue(EXPRESSION_PARSER_PROPERTY, new LegacyJSFELExpressionParser(
+ DefaultExpressionFactoryUtils.createExpressionFactory()));
+ } else {
parseExpressionParser(element, definitionBuilder);
}
parseViewFactoryCreator(element, definitionBuilder);
@@ -44,13 +66,10 @@ public class FacesFlowBuilderServicesBeanDefinitionParser extends AbstractSingle
private boolean parseEnableManagedBeans(Element element, BeanDefinitionBuilder definitionBuilder) {
String enableManagedBeans = element.getAttribute(ENABLE_MANAGED_BEANS_ATTRIBUTE);
if (StringUtils.hasText(enableManagedBeans)) {
- boolean enabled = Boolean.parseBoolean(enableManagedBeans);
- if (enabled) {
- definitionBuilder.addPropertyValue(EXPRESSION_PARSER_PROPERTY, new LegacyJSFELExpressionParser());
- }
- return enabled;
+ return Boolean.valueOf(enableManagedBeans).booleanValue();
+ } else {
+ return false;
}
- return false;
}
private void parseConversionService(Element element, BeanDefinitionBuilder definitionBuilder) {
@@ -76,7 +95,8 @@ public class FacesFlowBuilderServicesBeanDefinitionParser extends AbstractSingle
if (StringUtils.hasText(expressionParser)) {
definitionBuilder.addPropertyReference(EXPRESSION_PARSER_PROPERTY, expressionParser);
} else {
- definitionBuilder.addPropertyValue(EXPRESSION_PARSER_PROPERTY, new WebFlowELExpressionParser());
+ definitionBuilder.addPropertyValue(EXPRESSION_PARSER_PROPERTY, new WebFlowELExpressionParser(
+ DefaultExpressionFactoryUtils.createExpressionFactory()));
}
}
}
diff --git a/spring-faces/src/main/java/org/springframework/faces/expression/CompositeFlowPropertyResolver.java b/spring-faces/src/main/java/org/springframework/faces/expression/CompositeFlowPropertyResolver.java
index 009bb345..183ea1c3 100644
--- a/spring-faces/src/main/java/org/springframework/faces/expression/CompositeFlowPropertyResolver.java
+++ b/spring-faces/src/main/java/org/springframework/faces/expression/CompositeFlowPropertyResolver.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.expression;
import javax.el.CompositeELResolver;
diff --git a/spring-faces/src/main/java/org/springframework/faces/expression/CompositeFlowVariableResolver.java b/spring-faces/src/main/java/org/springframework/faces/expression/CompositeFlowVariableResolver.java
index 57b9abdb..563d9c23 100644
--- a/spring-faces/src/main/java/org/springframework/faces/expression/CompositeFlowVariableResolver.java
+++ b/spring-faces/src/main/java/org/springframework/faces/expression/CompositeFlowVariableResolver.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.expression;
import javax.el.CompositeELResolver;
diff --git a/spring-faces/src/main/java/org/springframework/faces/expression/ELDelegatingPropertyResolver.java b/spring-faces/src/main/java/org/springframework/faces/expression/ELDelegatingPropertyResolver.java
index 01a549b7..0ceaa5d7 100644
--- a/spring-faces/src/main/java/org/springframework/faces/expression/ELDelegatingPropertyResolver.java
+++ b/spring-faces/src/main/java/org/springframework/faces/expression/ELDelegatingPropertyResolver.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.expression;
import javax.el.ELContext;
diff --git a/spring-faces/src/main/java/org/springframework/faces/expression/ELDelegatingVariableResolver.java b/spring-faces/src/main/java/org/springframework/faces/expression/ELDelegatingVariableResolver.java
index 9984f0b1..1ea87cb7 100644
--- a/spring-faces/src/main/java/org/springframework/faces/expression/ELDelegatingVariableResolver.java
+++ b/spring-faces/src/main/java/org/springframework/faces/expression/ELDelegatingVariableResolver.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.expression;
import javax.el.ELContext;
diff --git a/spring-faces/src/main/java/org/springframework/faces/expression/LegacyJSFBeanResolver.java b/spring-faces/src/main/java/org/springframework/faces/expression/LegacyJSFBeanResolver.java
index ceadc25c..cb3c3fa5 100644
--- a/spring-faces/src/main/java/org/springframework/faces/expression/LegacyJSFBeanResolver.java
+++ b/spring-faces/src/main/java/org/springframework/faces/expression/LegacyJSFBeanResolver.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.expression;
import java.util.Iterator;
diff --git a/spring-faces/src/main/java/org/springframework/faces/expression/LegacyJSFELExpressionParser.java b/spring-faces/src/main/java/org/springframework/faces/expression/LegacyJSFELExpressionParser.java
index 43a49851..da1f98e0 100644
--- a/spring-faces/src/main/java/org/springframework/faces/expression/LegacyJSFELExpressionParser.java
+++ b/spring-faces/src/main/java/org/springframework/faces/expression/LegacyJSFELExpressionParser.java
@@ -1,21 +1,33 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.expression;
import java.util.ArrayList;
import java.util.List;
import javax.el.ELContext;
-import javax.el.ELException;
import javax.el.ELResolver;
import javax.el.ExpressionFactory;
import javax.el.FunctionMapper;
import javax.el.VariableMapper;
-import org.springframework.beans.BeanUtils;
import org.springframework.binding.expression.el.DefaultELResolver;
import org.springframework.binding.expression.el.ELContextFactory;
import org.springframework.binding.expression.el.ELExpressionParser;
import org.springframework.util.ClassUtils;
-import org.springframework.util.ReflectionUtils;
import org.springframework.webflow.core.collection.MutableAttributeMap;
import org.springframework.webflow.execution.RequestContext;
import org.springframework.webflow.expression.el.ActionMethodELResolver;
@@ -33,46 +45,24 @@ import org.springframework.webflow.expression.el.SpringSecurityELResolver;
*/
public class LegacyJSFELExpressionParser extends ELExpressionParser {
- private static final String EXPRESSION_FACTORY_PROPERTY = "javax.el.ExpressionFactory";
-
- private static final String DEFAULT_EXPRESSION_FACTORY = "org.jboss.el.ExpressionFactoryImpl";
-
public LegacyJSFELExpressionParser(ExpressionFactory expressionFactory) {
super(expressionFactory);
putContextFactory(RequestContext.class, new RequestContextELContextFactory());
putContextFactory(MutableAttributeMap.class, new AttributeMapELContextFactory());
}
- public LegacyJSFELExpressionParser() {
- this(getDefaultExpressionFactory());
- }
-
- private static ExpressionFactory getDefaultExpressionFactory() {
- if (!System.getProperties().containsKey(EXPRESSION_FACTORY_PROPERTY)) {
- System.setProperty(EXPRESSION_FACTORY_PROPERTY, DEFAULT_EXPRESSION_FACTORY);
- }
- if (ReflectionUtils.findMethod(ExpressionFactory.class, "newInstance") != null) {
- return ExpressionFactory.newInstance();
- } else { // Fallback in case using an older version of el-api
- try {
- return (ExpressionFactory) BeanUtils.instantiateClass(Class.forName(DEFAULT_EXPRESSION_FACTORY));
- } catch (Exception e) {
- throw new ELException("Could not create the default ExpressionFactory", e);
- }
- }
- }
-
private static class RequestContextELContextFactory implements ELContextFactory {
public ELContext getELContext(Object target) {
+ RequestContext context = (RequestContext) target;
List customResolvers = new ArrayList();
- customResolvers.add(new RequestContextELResolver());
+ customResolvers.add(new RequestContextELResolver(context));
+ customResolvers.add(new ImplicitFlowVariableELResolver(context));
+ customResolvers.add(new ScopeSearchingELResolver(context));
+ customResolvers.add(new ActionMethodELResolver());
if (ClassUtils.isPresent("org.springframework.security.context.SecurityContextHolder")) {
customResolvers.add(new SpringSecurityELResolver());
}
- customResolvers.add(new ImplicitFlowVariableELResolver());
- customResolvers.add(new SpringBeanWebFlowELResolver());
- customResolvers.add(new ActionMethodELResolver());
- customResolvers.add(new ScopeSearchingELResolver());
+ customResolvers.add(new SpringBeanWebFlowELResolver(context));
customResolvers.add(new LegacyJSFBeanResolver());
ELResolver resolver = new DefaultELResolver(target, customResolvers);
return new WebFlowELContext(resolver);
diff --git a/spring-faces/src/main/java/org/springframework/faces/expression/SimpleELContext.java b/spring-faces/src/main/java/org/springframework/faces/expression/SimpleELContext.java
index e5737dd9..56ac9fd6 100644
--- a/spring-faces/src/main/java/org/springframework/faces/expression/SimpleELContext.java
+++ b/spring-faces/src/main/java/org/springframework/faces/expression/SimpleELContext.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.expression;
import javax.el.ELContext;
diff --git a/spring-faces/src/main/java/org/springframework/faces/model/ManySelectionTrackingListDataModel.java b/spring-faces/src/main/java/org/springframework/faces/model/ManySelectionTrackingListDataModel.java
index 05595c77..af38353f 100644
--- a/spring-faces/src/main/java/org/springframework/faces/model/ManySelectionTrackingListDataModel.java
+++ b/spring-faces/src/main/java/org/springframework/faces/model/ManySelectionTrackingListDataModel.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.model;
import java.util.ArrayList;
diff --git a/spring-faces/src/main/java/org/springframework/faces/model/OneSelectionTrackingListDataModel.java b/spring-faces/src/main/java/org/springframework/faces/model/OneSelectionTrackingListDataModel.java
index 0c287a21..757d66c9 100644
--- a/spring-faces/src/main/java/org/springframework/faces/model/OneSelectionTrackingListDataModel.java
+++ b/spring-faces/src/main/java/org/springframework/faces/model/OneSelectionTrackingListDataModel.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.model;
import java.util.ArrayList;
diff --git a/spring-faces/src/main/java/org/springframework/faces/model/SelectionAware.java b/spring-faces/src/main/java/org/springframework/faces/model/SelectionAware.java
index e2dbdadf..c785b64f 100644
--- a/spring-faces/src/main/java/org/springframework/faces/model/SelectionAware.java
+++ b/spring-faces/src/main/java/org/springframework/faces/model/SelectionAware.java
@@ -1,6 +1,22 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.model;
import java.util.List;
+
import javax.faces.model.DataModel;
/**
diff --git a/spring-faces/src/main/java/org/springframework/faces/model/SelectionTrackingActionListener.java b/spring-faces/src/main/java/org/springframework/faces/model/SelectionTrackingActionListener.java
index 517fb0e9..450cd92f 100644
--- a/spring-faces/src/main/java/org/springframework/faces/model/SelectionTrackingActionListener.java
+++ b/spring-faces/src/main/java/org/springframework/faces/model/SelectionTrackingActionListener.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.model;
import javax.faces.component.UIComponent;
diff --git a/spring-faces/src/main/java/org/springframework/faces/model/SerializableListDataModel.java b/spring-faces/src/main/java/org/springframework/faces/model/SerializableListDataModel.java
index 7be47aba..0def242e 100644
--- a/spring-faces/src/main/java/org/springframework/faces/model/SerializableListDataModel.java
+++ b/spring-faces/src/main/java/org/springframework/faces/model/SerializableListDataModel.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.model;
import java.io.Serializable;
diff --git a/spring-faces/src/main/java/org/springframework/faces/model/converter/DataModelConverter.java b/spring-faces/src/main/java/org/springframework/faces/model/converter/DataModelConverter.java
index 7da09da9..c94c7f08 100644
--- a/spring-faces/src/main/java/org/springframework/faces/model/converter/DataModelConverter.java
+++ b/spring-faces/src/main/java/org/springframework/faces/model/converter/DataModelConverter.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.model.converter;
import java.lang.reflect.Constructor;
diff --git a/spring-faces/src/main/java/org/springframework/faces/model/converter/FacesConversionService.java b/spring-faces/src/main/java/org/springframework/faces/model/converter/FacesConversionService.java
index ab00f7c8..66867703 100644
--- a/spring-faces/src/main/java/org/springframework/faces/model/converter/FacesConversionService.java
+++ b/spring-faces/src/main/java/org/springframework/faces/model/converter/FacesConversionService.java
@@ -1,3 +1,15 @@
+/*
+ * Copyright 2004-2008 the original author or authimport org.springframework.binding.convert.ConversionService;
+import org.springframework.binding.convert.support.DefaultConversionService;
+import org.springframework.faces.model.OneSelectionTrackingListDataModel;
+e.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.model.converter;
import org.springframework.binding.convert.ConversionService;
diff --git a/spring-faces/src/main/java/org/springframework/faces/mvc/JsfView.java b/spring-faces/src/main/java/org/springframework/faces/mvc/JsfView.java
index 9120902a..c6db6e25 100644
--- a/spring-faces/src/main/java/org/springframework/faces/mvc/JsfView.java
+++ b/spring-faces/src/main/java/org/springframework/faces/mvc/JsfView.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.mvc;
import java.io.IOException;
diff --git a/spring-faces/src/main/java/org/springframework/faces/support/RequestLoggingPhaseListener.java b/spring-faces/src/main/java/org/springframework/faces/support/RequestLoggingPhaseListener.java
index 6e2a5e59..6a87eff2 100644
--- a/spring-faces/src/main/java/org/springframework/faces/support/RequestLoggingPhaseListener.java
+++ b/spring-faces/src/main/java/org/springframework/faces/support/RequestLoggingPhaseListener.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original authorimport javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.support;
import javax.faces.event.PhaseEvent;
diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/resource/FlowResourceHelper.java b/spring-faces/src/main/java/org/springframework/faces/ui/resource/FlowResourceHelper.java
index c6116da2..af296593 100644
--- a/spring-faces/src/main/java/org/springframework/faces/ui/resource/FlowResourceHelper.java
+++ b/spring-faces/src/main/java/org/springframework/faces/ui/resource/FlowResourceHelper.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.ui.resource;
import java.io.IOException;
diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/resource/ResourceServlet.java b/spring-faces/src/main/java/org/springframework/faces/ui/resource/ResourceServlet.java
index 094bf5d7..432f25fc 100644
--- a/spring-faces/src/main/java/org/springframework/faces/ui/resource/ResourceServlet.java
+++ b/spring-faces/src/main/java/org/springframework/faces/ui/resource/ResourceServlet.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.ui.resource;
import java.io.IOException;
diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowActionListener.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowActionListener.java
index a1f5f95f..3095caa7 100644
--- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowActionListener.java
+++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowActionListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2007 the original author or authors.
+ * Copyright 2004-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContext.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContext.java
index ccc13d02..a3f783ab 100644
--- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContext.java
+++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2007 the original author or authors.
+ * Copyright 2004-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowLifecycle.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowLifecycle.java
index f34e2689..b4868cf4 100644
--- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowLifecycle.java
+++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowLifecycle.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2007 the original author or authors.
+ * Copyright 2004-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowViewHandler.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowViewHandler.java
index 0e11439a..44a0b6d6 100644
--- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowViewHandler.java
+++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowViewHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2007 the original author or authors.
+ * Copyright 2004-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowViewStateManager.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowViewStateManager.java
index 3ded510c..bdb14515 100644
--- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowViewStateManager.java
+++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowViewStateManager.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2004-2008 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.springframework.faces.webflow;
import java.io.IOException;
diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfFinalResponseAction.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfFinalResponseAction.java
deleted file mode 100644
index 724a43f7..00000000
--- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfFinalResponseAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2004-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.faces.webflow;
-
-import javax.faces.component.UIViewRoot;
-
-import org.springframework.webflow.engine.EndState;
-import org.springframework.webflow.execution.Action;
-import org.springframework.webflow.execution.Event;
-import org.springframework.webflow.execution.RequestContext;
-import org.springframework.webflow.execution.View;
-
-/**
- * Specialized {@link Action} implementation for rendering the JSF view in an {@link EndState}.
- *
- * Before the final view is rendered, the {@link UIViewRoot} will be marked transient in order to bypass the JSF state
- * saving process.
- *
- * @author Jeremy Grelle
- */
-public class JsfFinalResponseAction implements Action {
-
- private JsfViewFactory viewFactory;
-
- public JsfFinalResponseAction(JsfViewFactory viewFactory) {
- this.viewFactory = viewFactory;
- }
-
- public Event execute(RequestContext context) throws Exception {
- View view = viewFactory.getView(context);
- ((JsfView) view).getViewRoot().setTransient(true);
- view.render();
- return new Event(this, "success");
- }
-
-}
diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfUtils.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfUtils.java
index d716f6be..55e9b47b 100644
--- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfUtils.java
+++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2007 the original author or authors.
+ * Copyright 2004-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfView.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfView.java
index d6ef8af6..c796fa99 100644
--- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfView.java
+++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfView.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2007 the original author or authors.
+ * Copyright 2004-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java
index d785bc83..ccf9ffbf 100644
--- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java
+++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2007 the original author or authors.
+ * Copyright 2004-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactoryCreator.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactoryCreator.java
index 7db89c25..11a7cc74 100644
--- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactoryCreator.java
+++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactoryCreator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2007 the original author or authors.
+ * Copyright 2004-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFinalResponseActionTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFinalResponseActionTests.java
index 494057c1..98a9a6a5 100644
--- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFinalResponseActionTests.java
+++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfFinalResponseActionTests.java
@@ -29,6 +29,7 @@ import org.springframework.webflow.core.collection.LocalAttributeMap;
import org.springframework.webflow.core.collection.LocalParameterMap;
import org.springframework.webflow.execution.RequestContext;
import org.springframework.webflow.execution.RequestContextHolder;
+import org.springframework.webflow.execution.View;
import org.springframework.webflow.expression.el.WebFlowELExpressionParser;
import org.springframework.webflow.test.MockExternalContext;
@@ -38,8 +39,6 @@ public class JsfFinalResponseActionTests extends TestCase {
private JsfViewFactory factory;
- private JsfFinalResponseAction finalResponseAction;
-
private JSFMockHelper jsfMock = new JSFMockHelper();
private RequestContext context = (RequestContext) EasyMock.createMock(RequestContext.class);
@@ -73,7 +72,6 @@ public class JsfFinalResponseActionTests extends TestCase {
lifecycle = new TestLifecycle(jsfMock.lifecycle());
factory = new JsfViewFactory(parser.parseExpression("#{'" + VIEW_ID + "'}", new ParserContextImpl().template()
.eval(RequestContext.class).expect(String.class)), null, lifecycle);
- finalResponseAction = new JsfFinalResponseAction(factory);
RequestContextHolder.setRequestContext(context);
MockExternalContext ext = new MockExternalContext();
ext.setNativeContext(new MockServletContext());
@@ -94,7 +92,9 @@ public class JsfFinalResponseActionTests extends TestCase {
EasyMock.replay(new Object[] { context });
- finalResponseAction.execute(context);
+ View view = factory.getView(context);
+ ((JsfView) view).getViewRoot().setTransient(true);
+ view.render();
assertTrue(newRoot.isTransient());
assertTrue(((NoRenderViewHandler) viewHandler).rendered);
diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/intro.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/intro.xhtml
index 34c9e510..f4feb078 100755
--- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/intro.xhtml
+++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/intro.xhtml
@@ -29,7 +29,7 @@
Spring IDE tooling integration, with support for graphical flow modeling and visualization
- Start your Spring Travel experience
+ Start your Spring Travel experience
diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web-application-config.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web-application-config.xml
index 350b03e6..853fe98c 100755
--- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web-application-config.xml
+++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web-application-config.xml
@@ -23,19 +23,29 @@
-
-
-
-
+
-
-
-
+
+
+
+
+
+ /main=flowController
+ /booking=flowController
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
@@ -54,7 +64,6 @@
-
@@ -69,6 +78,9 @@
+
+
+
@@ -120,5 +132,5 @@
-
+
\ No newline at end of file
diff --git a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/intro.jsp b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/intro.jsp
index 30b41d0a..9399eec6 100755
--- a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/intro.jsp
+++ b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/intro.jsp
@@ -6,21 +6,26 @@
-
Welcome to the Spring Web Flow + Spring MVC Sample Application
+
Welcome to Spring Travel
+
+ This reference application shows how to use Spring MVC and Web Flow together with JavaServerPages (JSP) and Tiles to develop web applications.
+
- This hotel booking sample application illustrates Spring Web Flow in a Spring MVC environment.
The key features illustrated in this sample include:
- - A unified navigation model
- - A robust state management model
- - Modularization of web application functionality by domain responsibility
- - Flow-managed persistence contexts with the Java Persistence API (JPA)
- - OGNL Expression Language (EL) integration
- - Spring IDE integration, with support for graphical flow modeling
+ - A declarative navigation model enabling full browser button support and dynamic navigation rules
+ - A fine-grained state management model, including support for ConversationScope and ViewScope
+ - Modularization of web application functionality by domain use case, illustrating project structure best-practices
+ - Managed persistence contexts with the Java Persistence API (JPA)
+ - Unified Expression Language (EL) integration
+ - Spring Security integration
+ - Applying reusable page layouts with Tiles
+ - Exception handling support across all layers of the application
+ - Spring IDE tooling integration, with support for graphical flow modeling and visualization
- Start your hotel booking experience
+ Start your Spring Travel experience
diff --git a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/web-application-config.xml b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/web-application-config.xml
index c512e1b6..57a3c565 100755
--- a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/web-application-config.xml
+++ b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/web-application-config.xml
@@ -14,41 +14,39 @@
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.xsd">
-
+
+
- /intro=urlFilenameController
- /login=urlFilenameController
- /logout-success=urlFilenameController
+ /main=flowController
+ /booking=flowController
-
+
+
+
+
-
+
+
-
+
+
-
-
+
+
+
-
-
-
-
-
-
-
-
@@ -58,10 +56,7 @@
-
-
-
-
+
@@ -72,7 +67,7 @@
-
+
@@ -103,7 +98,7 @@
-
+
diff --git a/spring-webflow/.classpath b/spring-webflow/.classpath
index 87a8c853..c30ae543 100644
--- a/spring-webflow/.classpath
+++ b/spring-webflow/.classpath
@@ -10,13 +10,9 @@
-
-
-
-
@@ -30,7 +26,6 @@
-
@@ -38,7 +33,7 @@
-
+
@@ -47,7 +42,5 @@
-
-
diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/EnableFlowScopesBeanDefinitionParser.java b/spring-webflow/src/main/java/org/springframework/webflow/config/EnableFlowScopesBeanDefinitionParser.java
index 189ff831..ec70fb4b 100644
--- a/spring-webflow/src/main/java/org/springframework/webflow/config/EnableFlowScopesBeanDefinitionParser.java
+++ b/spring-webflow/src/main/java/org/springframework/webflow/config/EnableFlowScopesBeanDefinitionParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2007 the original author or authors.
+ * Copyright 2004-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/support/DefaultTargetStateResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/support/DefaultTargetStateResolver.java
index cc62eb41..15b378af 100644
--- a/spring-webflow/src/main/java/org/springframework/webflow/engine/support/DefaultTargetStateResolver.java
+++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/support/DefaultTargetStateResolver.java
@@ -35,7 +35,7 @@ public class DefaultTargetStateResolver implements TargetStateResolver {
/**
* The expression for the target state identifier.
*/
- private Expression targetStateExpression;
+ private Expression targetStateIdExpression;
/**
* Creates a new target state resolver that always returns the same target state id.
@@ -47,15 +47,15 @@ public class DefaultTargetStateResolver implements TargetStateResolver {
/**
* Creates a new target state resolver.
- * @param targetStateExpression the target state expression
+ * @param targetStateIdExpression the target state expression
*/
- public DefaultTargetStateResolver(Expression targetStateExpression) {
- Assert.notNull(targetStateExpression, "The target state expression is required");
- this.targetStateExpression = targetStateExpression;
+ public DefaultTargetStateResolver(Expression targetStateIdExpression) {
+ Assert.notNull(targetStateIdExpression, "The target state id expression is required");
+ this.targetStateIdExpression = targetStateIdExpression;
}
public State resolveTargetState(Transition transition, State sourceState, RequestContext context) {
- String targetStateId = (String) targetStateExpression.getValue(context);
+ String targetStateId = (String) targetStateIdExpression.getValue(context);
if (targetStateId != null) {
return ((Flow) context.getActiveFlow()).getStateInstance(targetStateId);
} else {
@@ -64,6 +64,6 @@ public class DefaultTargetStateResolver implements TargetStateResolver {
}
public String toString() {
- return targetStateExpression.toString();
+ return targetStateIdExpression.toString();
}
}
\ No newline at end of file
diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/DefaultExpressionParserFactory.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/DefaultExpressionParserFactory.java
index a32ebd15..1e5c1a31 100644
--- a/spring-webflow/src/main/java/org/springframework/webflow/expression/DefaultExpressionParserFactory.java
+++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/DefaultExpressionParserFactory.java
@@ -15,17 +15,26 @@
*/
package org.springframework.webflow.expression;
+import javax.el.ExpressionFactory;
+
import org.springframework.binding.expression.Expression;
import org.springframework.binding.expression.ExpressionParser;
import org.springframework.binding.expression.ParserContext;
import org.springframework.binding.expression.ParserException;
+import org.springframework.binding.expression.el.DefaultExpressionFactoryUtils;
+import org.springframework.util.ClassUtils;
+import org.springframework.webflow.expression.el.WebFlowELExpressionParser;
/**
- * Static helper factory that creates instances of the default expression parser used by Spring Web Flow when requested.
- * Marked final with a private constructor to prevent subclassing.
+ * Static factory that returns the default {@link ExpressionParser} for use by Spring Web Flow. Marked final with a
+ * private constructor to prevent subclassing.
*
- * The default is an OGNL based expression parser. Also asserts that OGNL is in the classpath the first time the parser
- * is used.
+ * This factory employs the following algorithm when the returned ExpressionParser instance is used for the first time:
+ *
+ * - If a Unified EL implementation is configured for the VM, make the ELExpressionParser the default.
+ *
- If no Unified EL implementation is configured and OGNL is configured, make the OgnlExpressionParser the default.
+ *
- If neither Unified EL or OGNL are configured, throw an IllegalStateException.
+ *
*
* @author Keith Donald
* @author Erwin Vervaet
@@ -42,13 +51,13 @@ public final class DefaultExpressionParserFactory {
}
/**
- * Returns the default expression parser. The returned expression parser is a thread-safe object.
+ * Returns the default expression parser for Spring Web Flow. The returned instance is a thread-safe object.
* @return the expression parser
*/
public static synchronized ExpressionParser getExpressionParser() {
// return a wrapper that will lazily load the default expression parser
- // this prevents the default OGNL-based parser from being initialized until it is actually used
- // which allows OGNL to be an optional dependency if the expression parser wrapper is replaced and never used
+ // this prevents the underlying parser from being initialized until it is actually used
+ // this allows the EL to be an optional dependency if the expression parser wrapper is replaced and never used
return new ExpressionParser() {
public Expression parseExpression(String expressionString, ParserContext context) throws ParserException {
return getDefaultExpressionParser().parseExpression(expressionString, context);
@@ -68,23 +77,24 @@ public final class DefaultExpressionParserFactory {
}
/**
- * Create the default expression parser.
- * @return the default expression parser
+ * Create the default expression parser. This implementation tries EL first, then OGNL if EL is not configured.
+ * @return the default Web Flow expression parser
*/
private static ExpressionParser createDefaultExpressionParser() throws IllegalStateException {
try {
- Class.forName("ognl.Ognl");
- return new WebFlowOgnlExpressionParser();
- } catch (ClassNotFoundException e) {
- throw new IllegalStateException(
- "Unable to load the default expression parser: OGNL could not be found in the classpath. "
- + "Please add OGNL 2.x to your classpath or set the default ExpressionParser instance to something that is in the classpath. "
- + "Details: " + e.getMessage());
- } catch (NoClassDefFoundError e) {
- throw new IllegalStateException(
- "Unable to construct the default expression parser: ognl.Ognl could not be instantiated. "
- + "Please add OGNL 2.x to your classpath or set the default ExpressionParser instance to something that is in the classpath. "
- + "Details: " + e);
+ ExpressionFactory elFactory = DefaultExpressionFactoryUtils.createExpressionFactory();
+ return new WebFlowELExpressionParser(elFactory);
+ } catch (Exception e) {
+ try {
+ ClassUtils.forName("ognl.Ognl");
+ return new WebFlowOgnlExpressionParser();
+ } catch (ClassNotFoundException ex) {
+ throw new IllegalStateException(
+ "Unable to create the default expression parser for Spring Web Flow: Neither a Unified EL implementation or OGNL could be found.");
+ } catch (NoClassDefFoundError ex) {
+ throw new IllegalStateException(
+ "Unable to create the default expression parser for Spring Web Flow: Neither a Unified EL implementation or OGNL could be found.");
+ }
}
}
}
\ No newline at end of file
diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java
index 4c57653f..f9bc7493 100644
--- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java
+++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java
@@ -14,6 +14,15 @@ import org.springframework.webflow.execution.RequestContextHolder;
public class ImplicitFlowVariableELResolver extends ELResolver {
+ private RequestContext requestContext;
+
+ public ImplicitFlowVariableELResolver() {
+ }
+
+ public ImplicitFlowVariableELResolver(RequestContext requestContext) {
+ this.requestContext = requestContext;
+ }
+
public Class getCommonPropertyType(ELContext context, Object base) {
return Object.class;
}
@@ -23,10 +32,10 @@ public class ImplicitFlowVariableELResolver extends ELResolver {
}
public Class getType(ELContext context, Object base, Object property) {
- if (base != null || RequestContextHolder.getRequestContext() == null) {
+ RequestContext requestContext = getRequestContext();
+ if (base != null || requestContext == null) {
return null;
}
- RequestContext requestContext = RequestContextHolder.getRequestContext();
if (ImplicitVariables.matches(property)) {
context.setPropertyResolved(true);
return ImplicitVariables.value(context, requestContext, property).getClass();
@@ -36,10 +45,10 @@ public class ImplicitFlowVariableELResolver extends ELResolver {
}
public Object getValue(ELContext context, Object base, Object property) {
- if (base != null || RequestContextHolder.getRequestContext() == null) {
+ RequestContext requestContext = getRequestContext();
+ if (base != null || requestContext == null) {
return null;
}
- RequestContext requestContext = RequestContextHolder.getRequestContext();
if (ImplicitVariables.matches(property)) {
context.setPropertyResolved(true);
return ImplicitVariables.value(context, requestContext, property);
@@ -70,6 +79,10 @@ public class ImplicitFlowVariableELResolver extends ELResolver {
}
}
+ protected RequestContext getRequestContext() {
+ return requestContext != null ? requestContext : RequestContextHolder.getRequestContext();
+ }
+
private static final class ImplicitVariables {
private static final Set vars = new HashSet();
@@ -80,6 +93,8 @@ public class ImplicitFlowVariableELResolver extends ELResolver {
vars.add("flowScope");
vars.add("conversationScope");
vars.add("messageContext");
+ vars.add("flowExecutionContext");
+ vars.add("flowExecutionUrl");
}
private static final BeanELResolver internalResolver = new BeanELResolver();
diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/RequestContextELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/RequestContextELResolver.java
index 628aa91f..89ade2af 100644
--- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/RequestContextELResolver.java
+++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/RequestContextELResolver.java
@@ -11,7 +11,7 @@ import org.springframework.webflow.execution.RequestContextHolder;
/**
* Custom EL resolver that resolves to a thread-bound RequestContext object for binding expressions prefixed with a
- * {@link #REQUEST_CONTEXT_VARIABLE_NAME}. For instance "#{requestContext.conversationScope.myProperty}".
+ * {@link #REQUEST_CONTEXT_VARIABLE_NAME}. For instance "#{flowRequestContext.conversationScope.myProperty}".
* @author Jeremy Grelle
*/
public class RequestContextELResolver extends ELResolver {
@@ -19,7 +19,16 @@ public class RequestContextELResolver extends ELResolver {
/**
* Name of the request context variable.
*/
- public static final String REQUEST_CONTEXT_VARIABLE_NAME = "requestContext";
+ public static final String REQUEST_CONTEXT_VARIABLE_NAME = "flowRequestContext";
+
+ private RequestContext context;
+
+ public RequestContextELResolver() {
+ }
+
+ public RequestContextELResolver(RequestContext context) {
+ this.context = context;
+ }
public Class getCommonPropertyType(ELContext elContext, Object base) {
return Object.class;
@@ -41,7 +50,7 @@ public class RequestContextELResolver extends ELResolver {
public Object getValue(ELContext elContext, Object base, Object property) {
if (base == null && REQUEST_CONTEXT_VARIABLE_NAME.equals(property)) {
elContext.setPropertyResolved(true);
- return RequestContextHolder.getRequestContext();
+ return getRequestContext();
} else {
return null;
}
@@ -62,4 +71,9 @@ public class RequestContextELResolver extends ELResolver {
throw new PropertyNotWritableException("The RequestContext cannot be set with an expression.");
}
}
+
+ protected RequestContext getRequestContext() {
+ return context != null ? context : RequestContextHolder.getRequestContext();
+ }
+
}
\ No newline at end of file
diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ScopeSearchingELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ScopeSearchingELResolver.java
index 9fa3f944..d762672d 100644
--- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ScopeSearchingELResolver.java
+++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ScopeSearchingELResolver.java
@@ -19,6 +19,15 @@ import org.springframework.webflow.execution.RequestContextHolder;
*/
public class ScopeSearchingELResolver extends ELResolver {
+ private RequestContext requestContext;
+
+ public ScopeSearchingELResolver() {
+ }
+
+ public ScopeSearchingELResolver(RequestContext requestContext) {
+ this.requestContext = requestContext;
+ }
+
public Class getCommonPropertyType(ELContext elContext, Object base) {
return Object.class;
}
@@ -28,10 +37,10 @@ public class ScopeSearchingELResolver extends ELResolver {
}
public Class getType(ELContext elContext, Object base, Object property) {
- if (base != null || RequestContextHolder.getRequestContext() == null) {
+ RequestContext requestContext = getRequestContext();
+ if (base != null || requestContext == null) {
return null;
}
- RequestContext requestContext = RequestContextHolder.getRequestContext();
String attributeName = property.toString();
if (requestContext.getRequestScope().contains(attributeName)) {
elContext.setPropertyResolved(true);
@@ -51,10 +60,10 @@ public class ScopeSearchingELResolver extends ELResolver {
}
public Object getValue(ELContext elContext, Object base, Object property) {
- if (base != null || RequestContextHolder.getRequestContext() == null) {
+ RequestContext requestContext = getRequestContext();
+ if (base != null || requestContext == null) {
return null;
}
- RequestContext requestContext = RequestContextHolder.getRequestContext();
String attributeName = property.toString();
if (requestContext.getRequestScope().contains(attributeName)) {
elContext.setPropertyResolved(true);
@@ -74,10 +83,10 @@ public class ScopeSearchingELResolver extends ELResolver {
}
public boolean isReadOnly(ELContext elContext, Object base, Object property) {
- if (base != null || RequestContextHolder.getRequestContext() == null) {
+ RequestContext requestContext = getRequestContext();
+ if (base != null || requestContext == null) {
return false;
}
- RequestContext requestContext = RequestContextHolder.getRequestContext();
String attributeName = property.toString();
if (requestContext.getRequestScope().contains(attributeName)) {
elContext.setPropertyResolved(true);
@@ -97,10 +106,10 @@ public class ScopeSearchingELResolver extends ELResolver {
}
public void setValue(ELContext elContext, Object base, Object property, Object value) {
- if (base != null || RequestContextHolder.getRequestContext() == null) {
+ RequestContext requestContext = getRequestContext();
+ if (base != null || requestContext == null) {
return;
}
- RequestContext requestContext = RequestContextHolder.getRequestContext();
String attributeName = property.toString();
if (requestContext.getRequestScope().contains(attributeName)) {
elContext.setPropertyResolved(true);
@@ -116,4 +125,9 @@ public class ScopeSearchingELResolver extends ELResolver {
requestContext.getConversationScope().put(attributeName, value);
}
}
+
+ protected RequestContext getRequestContext() {
+ return requestContext != null ? requestContext : RequestContextHolder.getRequestContext();
+ }
+
}
\ No newline at end of file
diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringBeanWebFlowELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringBeanWebFlowELResolver.java
index c19cf3ff..dd3aa42e 100644
--- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringBeanWebFlowELResolver.java
+++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringBeanWebFlowELResolver.java
@@ -16,14 +16,27 @@ public class SpringBeanWebFlowELResolver extends SpringBeanELResolver {
private static final BeanFactory EMPTY_BEAN_FACTORY = new StaticListableBeanFactory();
+ private RequestContext context;
+
+ public SpringBeanWebFlowELResolver() {
+ }
+
+ public SpringBeanWebFlowELResolver(RequestContext context) {
+ this.context = context;
+ }
+
protected BeanFactory getBeanFactory(ELContext elContext) {
- RequestContext rc = RequestContextHolder.getRequestContext();
- if (rc != null && rc.getActiveFlow().getBeanFactory() != null) {
- BeanFactory factory = rc.getActiveFlow().getBeanFactory();
+ RequestContext requestContext = getRequestContext();
+ if (context != null && requestContext.getActiveFlow().getBeanFactory() != null) {
+ BeanFactory factory = requestContext.getActiveFlow().getBeanFactory();
return factory;
} else {
return EMPTY_BEAN_FACTORY;
}
}
+ protected RequestContext getRequestContext() {
+ return context != null ? context : RequestContextHolder.getRequestContext();
+ }
+
}
diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringSecurityELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringSecurityELResolver.java
index ea931c3c..85deadee 100644
--- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringSecurityELResolver.java
+++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringSecurityELResolver.java
@@ -42,7 +42,11 @@ public class SpringSecurityELResolver extends ELResolver {
public Object getValue(ELContext elContext, Object base, Object property) {
if (base == null && SECURITY_PRINCIPAL_VARIABLE_NAME.equals(property)) {
elContext.setPropertyResolved(true);
- return SecurityContextHolder.getContext().getAuthentication();
+ if (SecurityContextHolder.getContext() != null) {
+ return SecurityContextHolder.getContext().getAuthentication();
+ } else {
+ return null;
+ }
} else {
return null;
}
diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/WebFlowELExpressionParser.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/WebFlowELExpressionParser.java
index b7e3dfc8..ba5b8fb3 100644
--- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/WebFlowELExpressionParser.java
+++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/WebFlowELExpressionParser.java
@@ -4,18 +4,15 @@ import java.util.ArrayList;
import java.util.List;
import javax.el.ELContext;
-import javax.el.ELException;
import javax.el.ELResolver;
import javax.el.ExpressionFactory;
import javax.el.FunctionMapper;
import javax.el.VariableMapper;
-import org.springframework.beans.BeanUtils;
import org.springframework.binding.expression.el.DefaultELResolver;
import org.springframework.binding.expression.el.ELContextFactory;
import org.springframework.binding.expression.el.ELExpressionParser;
import org.springframework.util.ClassUtils;
-import org.springframework.util.ReflectionUtils;
import org.springframework.webflow.core.collection.MutableAttributeMap;
import org.springframework.webflow.execution.RequestContext;
@@ -28,46 +25,24 @@ import org.springframework.webflow.execution.RequestContext;
*/
public class WebFlowELExpressionParser extends ELExpressionParser {
- private static final String EXPRESSION_FACTORY_PROPERTY = "javax.el.ExpressionFactory";
-
- private static final String DEFAULT_EXPRESSION_FACTORY = "org.jboss.el.ExpressionFactoryImpl";
-
public WebFlowELExpressionParser(ExpressionFactory expressionFactory) {
super(expressionFactory);
putContextFactory(RequestContext.class, new RequestContextELContextFactory());
putContextFactory(MutableAttributeMap.class, new AttributeMapELContextFactory());
}
- public WebFlowELExpressionParser() {
- this(getDefaultExpressionFactory());
- }
-
- private static ExpressionFactory getDefaultExpressionFactory() {
- if (!System.getProperties().containsKey(EXPRESSION_FACTORY_PROPERTY)) {
- System.setProperty(EXPRESSION_FACTORY_PROPERTY, DEFAULT_EXPRESSION_FACTORY);
- }
- if (ReflectionUtils.findMethod(ExpressionFactory.class, "newInstance") != null) {
- return ExpressionFactory.newInstance();
- } else { // Fallback in case using an older version of el-api
- try {
- return (ExpressionFactory) BeanUtils.instantiateClass(Class.forName(DEFAULT_EXPRESSION_FACTORY));
- } catch (Exception e) {
- throw new ELException("Could not create the default ExpressionFactory", e);
- }
- }
- }
-
private static class RequestContextELContextFactory implements ELContextFactory {
public ELContext getELContext(Object target) {
+ RequestContext context = (RequestContext) target;
List customResolvers = new ArrayList();
- customResolvers.add(new RequestContextELResolver());
+ customResolvers.add(new RequestContextELResolver(context));
+ customResolvers.add(new ImplicitFlowVariableELResolver(context));
+ customResolvers.add(new ScopeSearchingELResolver(context));
+ customResolvers.add(new ActionMethodELResolver());
if (ClassUtils.isPresent("org.springframework.security.context.SecurityContextHolder")) {
customResolvers.add(new SpringSecurityELResolver());
}
- customResolvers.add(new ImplicitFlowVariableELResolver());
- customResolvers.add(new SpringBeanWebFlowELResolver());
- customResolvers.add(new ActionMethodELResolver());
- customResolvers.add(new ScopeSearchingELResolver());
+ customResolvers.add(new SpringBeanWebFlowELResolver(context));
ELResolver resolver = new DefaultELResolver(null, customResolvers);
return new WebFlowELContext(resolver);
}
diff --git a/spring-webflow/src/main/java/org/springframework/webflow/test/TestFlowBuilderServicesFactory.java b/spring-webflow/src/main/java/org/springframework/webflow/test/TestFlowBuilderServicesFactory.java
index 51145bb8..5127ea9c 100644
--- a/spring-webflow/src/main/java/org/springframework/webflow/test/TestFlowBuilderServicesFactory.java
+++ b/spring-webflow/src/main/java/org/springframework/webflow/test/TestFlowBuilderServicesFactory.java
@@ -11,22 +11,16 @@ import org.springframework.webflow.expression.DefaultExpressionParserFactory;
* @author Keith Donald
*/
public class TestFlowBuilderServicesFactory {
- private static FlowBuilderServices services;
-
private TestFlowBuilderServicesFactory() {
}
public static FlowBuilderServices getServices() {
- if (services != null) {
- return services;
- } else {
- services = new FlowBuilderServices();
- services.setViewFactoryCreator(new MockViewFactoryCreator());
- services.setConversionService(new DefaultConversionService());
- services.setExpressionParser(DefaultExpressionParserFactory.getExpressionParser());
- services.setResourceLoader(new DefaultResourceLoader());
- services.setBeanFactory(new StaticListableBeanFactory());
- return services;
- }
+ FlowBuilderServices services = new FlowBuilderServices();
+ services.setViewFactoryCreator(new MockViewFactoryCreator());
+ services.setConversionService(new DefaultConversionService());
+ services.setExpressionParser(DefaultExpressionParserFactory.getExpressionParser());
+ services.setResourceLoader(new DefaultResourceLoader());
+ services.setBeanFactory(new StaticListableBeanFactory());
+ return services;
}
}
\ No newline at end of file
diff --git a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowBuilderServicesBeanDefinitionParserTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowBuilderServicesBeanDefinitionParserTests.java
index ab9895ce..f05c3bef 100644
--- a/spring-webflow/src/test/java/org/springframework/webflow/config/FlowBuilderServicesBeanDefinitionParserTests.java
+++ b/spring-webflow/src/test/java/org/springframework/webflow/config/FlowBuilderServicesBeanDefinitionParserTests.java
@@ -13,7 +13,6 @@ import org.springframework.webflow.engine.builder.ViewFactoryCreator;
import org.springframework.webflow.engine.builder.support.FlowBuilderServices;
import org.springframework.webflow.execution.Action;
import org.springframework.webflow.execution.ViewFactory;
-import org.springframework.webflow.expression.el.WebFlowELExpressionParser;
import org.springframework.webflow.mvc.MvcViewFactoryCreator;
public class FlowBuilderServicesBeanDefinitionParserTests extends TestCase {
@@ -36,7 +35,7 @@ public class FlowBuilderServicesBeanDefinitionParserTests extends TestCase {
public void testFlowBuilderServicesCustomized() {
builderServices = (FlowBuilderServices) context.getBean("flowBuilderServicesCustom");
assertNotNull(builderServices);
- assertTrue(builderServices.getExpressionParser() instanceof WebFlowELExpressionParser);
+ assertNotNull(builderServices.getExpressionParser());
assertTrue(builderServices.getViewFactoryCreator() instanceof TestViewFactoryCreator);
assertTrue(builderServices.getConversionService() instanceof TestConversionService);
}
diff --git a/spring-webflow/src/test/java/org/springframework/webflow/config/flow-builder-services.xml b/spring-webflow/src/test/java/org/springframework/webflow/config/flow-builder-services.xml
index eaff930a..fcc72b91 100644
--- a/spring-webflow/src/test/java/org/springframework/webflow/config/flow-builder-services.xml
+++ b/spring-webflow/src/test/java/org/springframework/webflow/config/flow-builder-services.xml
@@ -15,7 +15,7 @@
view-factory-creator="customViewFactoryCreator"
conversion-service="customConversionService"/>
-
+
diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTargetStateResolverTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTargetStateResolverTests.java
index a8834121..87ff4aa2 100644
--- a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTargetStateResolverTests.java
+++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTargetStateResolverTests.java
@@ -39,7 +39,7 @@ public class TextToTargetStateResolverTests extends TestCase {
}
public void testDynamic() {
- String expression = "${flowScope.lastState}";
+ String expression = "#{flowScope.lastState}";
TargetStateResolver resolver = (TargetStateResolver) converter.convert(expression);
MockRequestContext context = new MockRequestContext();
context.getFlowScope().put("lastState", "mockState");
diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTransitionCriteriaTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTransitionCriteriaTests.java
index e9c34298..a1a86d04 100644
--- a/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTransitionCriteriaTests.java
+++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/builder/support/TextToTransitionCriteriaTests.java
@@ -17,6 +17,11 @@ package org.springframework.webflow.engine.builder.support;
import junit.framework.TestCase;
+import org.springframework.binding.expression.Expression;
+import org.springframework.binding.expression.ExpressionParser;
+import org.springframework.binding.expression.ParserContext;
+import org.springframework.binding.expression.ParserException;
+import org.springframework.binding.expression.support.StaticExpression;
import org.springframework.webflow.engine.Flow;
import org.springframework.webflow.engine.TransitionCriteria;
import org.springframework.webflow.engine.WildcardTransitionCriteria;
@@ -74,8 +79,12 @@ public class TextToTransitionCriteriaTests extends TestCase {
}
public void testNullExpressionEvaluation() throws Exception {
- String expression = "${null}";
- TransitionCriteria criterion = (TransitionCriteria) converter.convert(expression);
+ serviceLocator.getFlowBuilderServices().setExpressionParser(new ExpressionParser() {
+ public Expression parseExpression(String expressionString, ParserContext context) throws ParserException {
+ return new StaticExpression(null);
+ }
+ });
+ TransitionCriteria criterion = (TransitionCriteria) converter.convert("doesnt matter");
RequestContext ctx = getRequestContext();
assertFalse("Criterion should evaluate to false", criterion.test(ctx));
}
diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/DefaultExpressionParserFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/DefaultExpressionParserFactoryTests.java
index 99fbd8a9..34d36abf 100644
--- a/spring-webflow/src/test/java/org/springframework/webflow/expression/DefaultExpressionParserFactoryTests.java
+++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/DefaultExpressionParserFactoryTests.java
@@ -18,7 +18,6 @@ package org.springframework.webflow.expression;
import junit.framework.TestCase;
import org.springframework.binding.expression.ExpressionParser;
-import org.springframework.webflow.expression.DefaultExpressionParserFactory;
/**
* Unit tests for {@link DefaultExpressionParserFactory}.
diff --git a/spring-webflow/src/test/java/org/springframework/webflow/test/SearchFlowExecutionTests.java b/spring-webflow/src/test/java/org/springframework/webflow/test/SearchFlowExecutionTests.java
index 8f9c9338..f45b04f8 100644
--- a/spring-webflow/src/test/java/org/springframework/webflow/test/SearchFlowExecutionTests.java
+++ b/spring-webflow/src/test/java/org/springframework/webflow/test/SearchFlowExecutionTests.java
@@ -26,7 +26,6 @@ import org.springframework.webflow.context.ExternalContext;
import org.springframework.webflow.core.collection.AttributeMap;
import org.springframework.webflow.engine.EndState;
import org.springframework.webflow.engine.Flow;
-import org.springframework.webflow.expression.el.WebFlowELExpressionParser;
import org.springframework.webflow.test.execution.AbstractXmlFlowExecutionTests;
/**
@@ -68,7 +67,6 @@ public class SearchFlowExecutionTests extends AbstractXmlFlowExecutionTests {
}
protected void configureFlowBuilderContext(MockFlowBuilderContext builderContext) {
- builderContext.getFlowBuilderServices().setExpressionParser(new WebFlowELExpressionParser());
Flow mockDetailFlow = new Flow("detail-flow");
mockDetailFlow.setInputMapper(new AttributeMapper() {
public void map(Object source, Object target, MappingContext context) {