diff --git a/spring-faces/src/main/java/org/springframework/faces/config/ResourcesBeanDefinitionParser.java b/spring-faces/src/main/java/org/springframework/faces/config/ResourcesBeanDefinitionParser.java index 69330ecb..99035784 100644 --- a/spring-faces/src/main/java/org/springframework/faces/config/ResourcesBeanDefinitionParser.java +++ b/spring-faces/src/main/java/org/springframework/faces/config/ResourcesBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2012 the original author or authors. + * Copyright 2004-2016 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. @@ -18,17 +18,17 @@ package org.springframework.faces.config; import java.util.Map; +import org.w3c.dom.Element; + import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.ManagedMap; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.xml.BeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.faces.webflow.JsfRuntimeInformation; import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; import org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter; -import org.w3c.dom.Element; /** * Parser for the resources tag. @@ -39,101 +39,57 @@ import org.w3c.dom.Element; */ public class ResourcesBeanDefinitionParser implements BeanDefinitionParser { - static final String SERVLET_RESOURCE_HANDLER_BEAN_NAME = "jsfResourceRequestHandler"; - - static final String PORTLET_RESOURCE_HANDLER_BEAN_NAME = "jsfPortletResourceRequestHandler"; + private static final String SERVLET_RESOURCE_HANDLER_BEAN_NAME = "jsfResourceRequestHandler"; private static final boolean isRichFacesPresent = ClassUtils.isPresent("org.richfaces.application.CoreConfiguration", ResourcesBeanDefinitionParser.class.getClassLoader()); + public BeanDefinition parse(Element element, ParserContext parserContext) { - new ServletRegistrar(element, parserContext).register(); - if (JsfRuntimeInformation.isSpringPortletPresent()) { - new PortletRegistrar(element, parserContext).register(); - } + Object source = parserContext.extractSource(element); + registerHandlerAdapterIfNecessary(source, parserContext); + registerResourceHandler(source, parserContext); + registerHandlerMappings(element, source, parserContext); return null; } - private static abstract class Registrar { - protected final Element element; - - protected final ParserContext parserContext; - - protected final Object source; - - public Registrar(Element element, ParserContext parserContext) { - this.element = element; - this.parserContext = parserContext; - this.source = parserContext.extractSource(element); + private void registerHandlerAdapterIfNecessary(Object source, ParserContext parserContext) { + String beanName = "org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter"; + if (parserContext.getRegistry().containsBeanDefinition(beanName)) { + return; } - - public abstract void register(); + RootBeanDefinition beanDefinition = new RootBeanDefinition(HttpRequestHandlerAdapter.class); + beanDefinition.setSource(source); + beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); + parserContext.getReaderContext().registerWithGeneratedName(beanDefinition); } - private static class ServletRegistrar extends Registrar { - - public ServletRegistrar(Element element, ParserContext parserContext) { - super(element, parserContext); - } - - @Override - public void register() { - registerHandlerAdapterIfNecessary(); - registerResourceHandler(); - registerHandlerMappings(); - } - - private void registerHandlerAdapterIfNecessary() { - if (parserContext.getRegistry().containsBeanDefinition("org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter")) { - return; - } - RootBeanDefinition beanDefinition = new RootBeanDefinition(HttpRequestHandlerAdapter.class); - beanDefinition.setSource(source); - beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); - parserContext.getReaderContext().registerWithGeneratedName(beanDefinition); - } - - private void registerResourceHandler() { - RootBeanDefinition beanDefinition = new RootBeanDefinition("org.springframework.faces.webflow.JsfResourceRequestHandler"); - beanDefinition.setSource(source); - beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); - parserContext.getRegistry().registerBeanDefinition(SERVLET_RESOURCE_HANDLER_BEAN_NAME, beanDefinition); - } - - private void registerHandlerMappings() { - Map urlMap = new ManagedMap(); - urlMap.put("/javax.faces.resource/**", SERVLET_RESOURCE_HANDLER_BEAN_NAME); - - if (isRichFacesPresent) { - urlMap.put("/rfRes/**", SERVLET_RESOURCE_HANDLER_BEAN_NAME); - } - - RootBeanDefinition beanDefinition = new RootBeanDefinition(SimpleUrlHandlerMapping.class); - beanDefinition.setSource(source); - beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); - beanDefinition.getPropertyValues().add("urlMap", urlMap); - - String order = element.getAttribute("order"); - beanDefinition.getPropertyValues().add("order", StringUtils.hasText(order) ? order : 0); - parserContext.getReaderContext().registerWithGeneratedName(beanDefinition); - } + private void registerResourceHandler(Object source, ParserContext parserContext) { + String beanName = "org.springframework.faces.webflow.JsfResourceRequestHandler"; + RootBeanDefinition beanDefinition = new RootBeanDefinition(beanName); + beanDefinition.setSource(source); + beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); + parserContext.getRegistry().registerBeanDefinition(SERVLET_RESOURCE_HANDLER_BEAN_NAME, beanDefinition); } - private static class PortletRegistrar extends Registrar { + private void registerHandlerMappings(Element element, Object source, ParserContext parserContext) { + Map urlMap = new ManagedMap(); + urlMap.put("/javax.faces.resource/**", SERVLET_RESOURCE_HANDLER_BEAN_NAME); - public PortletRegistrar(Element element, ParserContext parserContext) { - super(element, parserContext); + if (isRichFacesPresent) { + urlMap.put("/rfRes/**", SERVLET_RESOURCE_HANDLER_BEAN_NAME); } - @Override - public void register() { - RootBeanDefinition beanDefinition = new RootBeanDefinition("org.springframework.faces.webflow.context.portlet.JsfResourceRequestHandler"); - beanDefinition.setSource(source); - beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); - parserContext.getRegistry().registerBeanDefinition(PORTLET_RESOURCE_HANDLER_BEAN_NAME, beanDefinition); - } + RootBeanDefinition beanDefinition = new RootBeanDefinition(SimpleUrlHandlerMapping.class); + beanDefinition.setSource(source); + beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); + beanDefinition.getPropertyValues().add("urlMap", urlMap); + + String order = element.getAttribute("order"); + beanDefinition.getPropertyValues().add("order", StringUtils.hasText(order) ? order : 0); + parserContext.getReaderContext().registerWithGeneratedName(beanDefinition); } } \ No newline at end of file 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 ecd7f091..dd5427c0 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 @@ -15,10 +15,7 @@ */ package org.springframework.faces.mvc; -import static org.springframework.faces.webflow.JsfRuntimeInformation.isPortletRequest; - import java.util.Map; - import javax.faces.application.ViewHandler; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; @@ -60,10 +57,7 @@ public class JsfView extends AbstractUrlBasedView { JsfUtils.notifyBeforeListeners(PhaseId.RESTORE_VIEW, this.facesLifecycle, facesContext); ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); - - if (!isPortletRequest(facesContext)) { - viewHandler.initView(facesContext); - } + viewHandler.initView(facesContext); UIViewRoot viewRoot = viewHandler.createView(facesContext, getUrl()); Assert.notNull(viewRoot, "A JSF view could not be created for " + getUrl()); diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FacesContextHelper.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FacesContextHelper.java index 871a47f5..475a3215 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FacesContextHelper.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FacesContextHelper.java @@ -66,8 +66,7 @@ public class FacesContextHelper { } /** - * Factory method that can be used to create a new default {@link FacesContext} instance for the running - * (Portlet/Servlet) environment. + * Factory method that can be used to create a new default {@link FacesContext} instance. * * @param context the native context * @param request the native request diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfRuntimeInformation.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfRuntimeInformation.java index d6a7ebd7..8948cfea 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfRuntimeInformation.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfRuntimeInformation.java @@ -20,10 +20,8 @@ import javax.faces.FacesWrapper; import javax.faces.FactoryFinder; import javax.faces.context.FacesContext; -import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.ReflectionUtils; -import org.springframework.webflow.execution.RequestContext; /** * Helper class to provide information about the JSF runtime environment such as @@ -80,12 +78,6 @@ public class JsfRuntimeInformation { private static boolean myFacesInUse = isMyFacesContextFactoryInUse(); - private static boolean portletPresent = ClassUtils.isPresent("javax.portlet.Portlet", CLASSLOADER); - - private static boolean springPortletPresent = - ClassUtils.isPresent("org.springframework.web.portlet.DispatcherPortlet", CLASSLOADER); - - public static boolean isAtLeastJsf22() { return jsfVersion >= JSF_22; @@ -143,46 +135,4 @@ public class JsfRuntimeInformation { } } - - /** - * Determines if the container has support for portlets and if Spring MVC portlet support is available - * - * @return true if a portlet environment is detected - */ - public static boolean isSpringPortletPresent() { - return portletPresent && springPortletPresent; - } - - /** - * Determine if the specified {@link FacesContext} is from a portlet request. - * @param context the faces context - * @return true if the request is from a portlet - */ - public static boolean isPortletRequest(FacesContext context) { - Assert.notNull(context, "Context must not be null"); - return isPortletContext(context.getExternalContext().getContext()); - } - - /** - * Determine if the specified {@link RequestContext} is from a portlet request. - * - * @param context the request context - * @return true if the request is from a portlet - */ - public static boolean isPortletRequest(RequestContext context) { - Assert.notNull(context, "Context must not be null"); - return isPortletContext(context.getExternalContext().getNativeContext()); - } - - /** - * Determine if the specified context object is from portlet. - * - * @param nativeContext the native context - * @return true if the context is from a portlet - */ - public static boolean isPortletContext(Object nativeContext) { - Assert.notNull(nativeContext, "Context must not be null"); - return ClassUtils.getMethodIfAvailable(nativeContext.getClass(), "getPortletContextName") != null; - } - } 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 864f83ff..7603c7d4 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 @@ -41,7 +41,6 @@ import org.springframework.webflow.execution.View; import org.springframework.webflow.execution.ViewFactory; import static org.springframework.faces.webflow.JsfRuntimeInformation.isMojarraPresent; -import static org.springframework.faces.webflow.JsfRuntimeInformation.isPortletRequest; /** * JSF-specific {@link ViewFactory} implementation. @@ -107,9 +106,7 @@ public class JsfViewFactory implements ViewFactory { private ViewHandler getViewHandler(FacesContext facesContext) { ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); - if (!isPortletRequest(facesContext)) { - viewHandler.initView(facesContext); - } + viewHandler.initView(facesContext); return viewHandler; } diff --git a/spring-faces/src/main/resources/META-INF/faces-config.xml b/spring-faces/src/main/resources/META-INF/faces-config.xml index 5db86ebd..386fb2d6 100644 --- a/spring-faces/src/main/resources/META-INF/faces-config.xml +++ b/spring-faces/src/main/resources/META-INF/faces-config.xml @@ -13,7 +13,6 @@ org.springframework.faces.webflow.FlowApplicationFactory - org.springframework.faces.webflow.context.portlet.PortletFacesContextFactory diff --git a/spring-faces/src/test/java/org/springframework/faces/config/AbstractResourcesConfigurationTests.java b/spring-faces/src/test/java/org/springframework/faces/config/AbstractResourcesConfigurationTests.java index 8322caf7..ae714b39 100644 --- a/spring-faces/src/test/java/org/springframework/faces/config/AbstractResourcesConfigurationTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/config/AbstractResourcesConfigurationTests.java @@ -26,7 +26,7 @@ public abstract class AbstractResourcesConfigurationTests extends TestCase { Map map = this.context.getBeansOfType(HttpRequestHandlerAdapter.class); assertEquals(1, map.values().size()); - Object resourceHandler = this.context.getBean(ResourcesBeanDefinitionParser.SERVLET_RESOURCE_HANDLER_BEAN_NAME); + Object resourceHandler = this.context.getBean("jsfResourceRequestHandler"); assertNotNull(resourceHandler); assertTrue(resourceHandler instanceof JsfResourceRequestHandler); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/AbstractFlowConfiguration.java b/spring-webflow/src/main/java/org/springframework/webflow/config/AbstractFlowConfiguration.java index 24e5b3c1..675efe9d 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/AbstractFlowConfiguration.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/AbstractFlowConfiguration.java @@ -61,7 +61,7 @@ public class AbstractFlowConfiguration implements ApplicationContextAware { * @return the created builder */ protected FlowExecutorBuilder getFlowExecutorBuilder(FlowDefinitionLocator flowRegistry) { - return new FlowExecutorBuilder(flowRegistry, this.applicationContext); + return new FlowExecutorBuilder(flowRegistry); } /** @@ -86,7 +86,7 @@ public class AbstractFlowConfiguration implements ApplicationContextAware { * @return the created builder */ protected FlowBuilderServicesBuilder getFlowBuilderServicesBuilder() { - return new FlowBuilderServicesBuilder(this.applicationContext); + return new FlowBuilderServicesBuilder(); } } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowBuilderServicesBuilder.java b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowBuilderServicesBuilder.java index cb7db463..ea00a717 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowBuilderServicesBuilder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowBuilderServicesBuilder.java @@ -52,21 +52,17 @@ public class FlowBuilderServicesBuilder { private boolean enableDevelopmentMode; + public FlowBuilderServicesBuilder() { + this.viewFactoryCreator = new MvcViewFactoryCreator(); + } + /** * Create a new instance with the given ApplicationContext. - * - * @param applicationContext the ApplicationContext to use to initialize a - * default ViewFactoryCreator instance with. + * @deprecated as of 2.5 an ApplicationContext is no longer required */ public FlowBuilderServicesBuilder(ApplicationContext applicationContext) { Assert.notNull(applicationContext, "applicationContext is required"); - this.viewFactoryCreator = initViewFactoryCreator(applicationContext); - } - - private static ViewFactoryCreator initViewFactoryCreator(ApplicationContext applicationContext) { - MvcViewFactoryCreator viewFactoryCreator = new MvcViewFactoryCreator(); - viewFactoryCreator.setApplicationContext(applicationContext); - return viewFactoryCreator; + this.viewFactoryCreator = new MvcViewFactoryCreator(); } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowDefinitionRegistryBuilder.java b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowDefinitionRegistryBuilder.java index 82459b2c..f4fb7b74 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowDefinitionRegistryBuilder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowDefinitionRegistryBuilder.java @@ -17,7 +17,6 @@ package org.springframework.webflow.config; import java.io.IOException; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -67,7 +66,7 @@ public class FlowDefinitionRegistryBuilder { /** * Create a new instance with the given ApplicationContext. * - * @param applicationContext the ApplicationContext to use for initializing the + * @param appContext the ApplicationContext to use for initializing the * FlowDefinitionResourceFactory and FlowBuilderServices instances with */ public FlowDefinitionRegistryBuilder(ApplicationContext appContext) { @@ -77,7 +76,7 @@ public class FlowDefinitionRegistryBuilder { /** * Create a new instance with the given ApplicationContext and {@link FlowBuilderServices}. * - * @param applicationContext the ApplicationContext to use for initializing the + * @param appContext the ApplicationContext to use for initializing the * FlowDefinitionResourceFactory and FlowBuilderServices instances with * @param builderServices a {@link FlowBuilderServices} instance to configure * on the FlowDefinitionRegistry @@ -89,7 +88,7 @@ public class FlowDefinitionRegistryBuilder { this.flowBuilderServices = builderServices; } else { - this.flowBuilderServices = new FlowBuilderServicesBuilder(appContext).build(); + this.flowBuilderServices = new FlowBuilderServicesBuilder().build(); this.flowBuilderServices.setApplicationContext(appContext); } } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorBuilder.java b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorBuilder.java index cd69c0c0..35a5788a 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorBuilder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorBuilder.java @@ -32,7 +32,6 @@ import org.springframework.webflow.execution.repository.snapshot.SerializedFlowE import org.springframework.webflow.execution.repository.snapshot.SimpleFlowExecutionSnapshotFactory; import org.springframework.webflow.executor.FlowExecutor; import org.springframework.webflow.executor.FlowExecutorImpl; -import org.springframework.webflow.mvc.builder.MvcEnvironment; /** * A builder for {@link FlowExecutor} instances designed for programmatic use in @@ -50,8 +49,6 @@ public class FlowExecutorBuilder { private Integer maxFlowExecutionSnapshots; - private MvcEnvironment environment; - private LocalAttributeMap executionAttributes = new LocalAttributeMap(); private ConditionalFlowExecutionListenerLoader listenerLoader; @@ -61,18 +58,21 @@ public class FlowExecutorBuilder { private ConversationManager conversationManager; + public FlowExecutorBuilder(FlowDefinitionLocator flowRegistry) { + Assert.notNull(flowRegistry, "FlowDefinitionLocator is required"); + this.flowRegistry = flowRegistry; + } + /** * Create a new instance with the given flow registry and ApplicationContext. * * @param flowRegistry the flow registry that will locate flow definitions - * @param applicationContext the Spring ApplicationContext to use for - * initializing an instance of {@link MvcEnvironment} + * @param applicationContext the Spring ApplicationContext + * @deprecated as of 2.5 an ApplicationContext is no longer required */ public FlowExecutorBuilder(FlowDefinitionLocator flowRegistry, ApplicationContext applicationContext) { Assert.notNull(flowRegistry, "FlowDefinitionLocator is required"); - Assert.notNull(applicationContext, "applicationContext is required"); this.flowRegistry = flowRegistry; - this.environment = MvcEnvironment.environmentFor(applicationContext); } @@ -216,10 +216,10 @@ public class FlowExecutorBuilder { private LocalAttributeMap getExecutionAttributes() { LocalAttributeMap attributes = new LocalAttributeMap(this.executionAttributes.asMap()); if (!attributes.contains("alwaysRedirectOnPause")) { - attributes.put("alwaysRedirectOnPause", (this.environment != MvcEnvironment.PORTLET)); + attributes.put("alwaysRedirectOnPause", true); } if (!attributes.contains("redirectInSameState")) { - attributes.put("redirectInSameState", (this.environment != MvcEnvironment.PORTLET)); + attributes.put("redirectInSameState", true); } return attributes; } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorFactoryBean.java b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorFactoryBean.java index 356ca714..52eb90ee 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorFactoryBean.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowExecutorFactoryBean.java @@ -17,15 +17,12 @@ package org.springframework.webflow.config; import java.util.Set; -import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.binding.convert.ConversionExecutor; import org.springframework.binding.convert.ConversionService; import org.springframework.binding.convert.service.DefaultConversionService; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.webflow.conversation.ConversationManager; @@ -45,7 +42,6 @@ import org.springframework.webflow.execution.repository.snapshot.SerializedFlowE import org.springframework.webflow.execution.repository.snapshot.SimpleFlowExecutionSnapshotFactory; import org.springframework.webflow.executor.FlowExecutor; import org.springframework.webflow.executor.FlowExecutorImpl; -import org.springframework.webflow.mvc.builder.MvcEnvironment; /** * This factory encapsulates the construction and assembly of a {@link FlowExecutor}, including the provision of its @@ -57,8 +53,7 @@ import org.springframework.webflow.mvc.builder.MvcEnvironment; * @author Keith Donald * @author Erwin Vervaet */ -class FlowExecutorFactoryBean implements FactoryBean, ApplicationContextAware, BeanClassLoaderAware, - InitializingBean { +class FlowExecutorFactoryBean implements FactoryBean, BeanClassLoaderAware, InitializingBean { private static final String ALWAYS_REDIRECT_ON_PAUSE = "alwaysRedirectOnPause"; @@ -80,8 +75,6 @@ class FlowExecutorFactoryBean implements FactoryBean, ApplicationC private FlowExecutor flowExecutor; - private MvcEnvironment environment; - private ClassLoader classLoader; /** @@ -133,12 +126,6 @@ class FlowExecutorFactoryBean implements FactoryBean, ApplicationC this.conversationManager = conversationManager; } - // implementing ApplicationContextAware - - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - environment = MvcEnvironment.environmentFor(applicationContext); - } - // implement BeanClassLoaderAware public void setBeanClassLoader(ClassLoader classLoader) { @@ -186,12 +173,10 @@ class FlowExecutorFactoryBean implements FactoryBean, ApplicationC private void putDefaultFlowExecutionAttributes(LocalAttributeMap executionAttributes) { if (!executionAttributes.contains(ALWAYS_REDIRECT_ON_PAUSE)) { - Boolean redirect = (environment != MvcEnvironment.PORTLET); - executionAttributes.put(ALWAYS_REDIRECT_ON_PAUSE, redirect); + executionAttributes.put(ALWAYS_REDIRECT_ON_PAUSE, true); } if (!executionAttributes.contains(REDIRECT_IN_SAME_STATE)) { - Boolean redirect = (environment != MvcEnvironment.PORTLET); - executionAttributes.put(REDIRECT_IN_SAME_STATE, redirect); + executionAttributes.put(REDIRECT_IN_SAME_STATE, true); } } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/ExternalContext.java b/spring-webflow/src/main/java/org/springframework/webflow/context/ExternalContext.java index 2cf7e21f..d99b8474 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/ExternalContext.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/context/ExternalContext.java @@ -73,8 +73,7 @@ public interface ExternalContext { * session and accessible to both internal and external SWF artifacts. *

* Note: most external context implementations do not distinguish between the concept of a "local" user session - * scope and a "global" session scope. The Portlet world does, but not the Servlet for example. In those cases - * calling this method returns the same map as calling {@link #getSessionMap()}. + * scope and a "global" session scope. Otherwise this method returns the same map as calling {@link #getSessionMap()}. * @return the mutable global session attribute map */ public SharedAttributeMap getGlobalSessionMap(); @@ -140,8 +139,7 @@ public interface ExternalContext { /** * Is a render response allowed to be written for this request? Always return false after a response has been - * completed. May return false before that to indicate a response is not allowed to be completed. For example, in a - * Portlet environment, render responses are only allowed in render requests. + * completed. May return false before that to indicate a response is not allowed to be completed. * @return true if yes, false otherwise */ public boolean isResponseAllowed(); @@ -215,4 +213,4 @@ public interface ExternalContext { */ public boolean isResponseCompleteFlowExecutionRedirect(); -} +} diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/web/package-info.java b/spring-webflow/src/main/java/org/springframework/webflow/context/web/package-info.java index 0a224283..305ea896 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/web/package-info.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/context/web/package-info.java @@ -15,7 +15,7 @@ */ /** - * Shared classes used by the Servlet and Portlet ExternalContext implementations. + * Shared classes used with Servlet or alternative ExternalContext implementations. */ package org.springframework.webflow.context.web; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java index d65c671a..0c995854 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java @@ -80,7 +80,7 @@ import org.springframework.webflow.execution.RequestContext; *

* This class and the rest of the Spring Web Flow (SWF) engine have been designed with minimal dependencies on other * libraries. Spring Web Flow is usable in a standalone fashion. The engine system is fully usable outside an HTTP - * servlet environment, for example in portlets, tests, or standalone applications. One of the major architectural + * servlet environment, for example in tests, or standalone applications. One of the major architectural * benefits of Spring Web Flow is the ability to design reusable, high-level controller modules that may be executed in * any environment. *

diff --git a/spring-webflow/src/main/java/org/springframework/webflow/execution/RequestContext.java b/spring-webflow/src/main/java/org/springframework/webflow/execution/RequestContext.java index c2dcbb7f..1aecb38e 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/execution/RequestContext.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/execution/RequestContext.java @@ -49,7 +49,7 @@ import org.springframework.webflow.definition.TransitionDefinition; * The web flow system will ensure that a RequestContext object is local to the current thread. It can be safely * manipulated without needing to worry about concurrent access. *

- * Note: this request context is in no way linked to an HTTP or Portlet request. It uses the familiar "request" naming + * Note: this request context is in no way linked to an HTTP request. It uses the familiar "request" naming * convention to indicate a single call to manipulate a runtime execution of a flow definition. * * @author Keith Donald @@ -151,7 +151,7 @@ public interface RequestContext { * constructs within that environment. *

* In addition, this context may be downcastable to a specific context type for a specific client environment, such - * as Servlets or Portlets. Such downcasting will give you full access to a native HttpServletRequest, for example. + * as Servlets. Such downcasting will give you full access to a native HttpServletRequest, for example. * With that said, for portability reasons you should avoid coupling your flow artifacts to a specific deployment * environment when possible. * @return the originating external context, the one that triggered the current execution request @@ -208,4 +208,4 @@ public interface RequestContext { */ public String getFlowExecutionUrl() throws IllegalStateException; -} +} diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/MvcEnvironment.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/MvcEnvironment.java deleted file mode 100644 index 20c1a9a7..00000000 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/MvcEnvironment.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.webflow.mvc.builder; - -import org.springframework.context.ApplicationContext; -import org.springframework.web.context.WebApplicationContext; - -/** - * Supported Spring Web MVC environments. - * - * @author Keith Donald - */ -public enum MvcEnvironment { - - /** - * Spring Web Servlet MVC. - */ - SERVLET, - - /** - * Spring Web Portlet MVC. - */ - PORTLET; - - /** - * Calculates the web environment from the state of the provided application context. - * @param applicationContext the application context - * @return the web environment the context is running in, or null if not running in a web environment - */ - public static MvcEnvironment environmentFor(ApplicationContext applicationContext) { - if (applicationContext instanceof WebApplicationContext) { - return MvcEnvironment.SERVLET; - } else { - return null; - } - } - -} diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/MvcViewFactoryCreator.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/MvcViewFactoryCreator.java index 623ab598..54c89ca1 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/MvcViewFactoryCreator.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/MvcViewFactoryCreator.java @@ -22,8 +22,6 @@ 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.util.StringUtils; import org.springframework.validation.DefaultMessageCodesResolver; import org.springframework.validation.MessageCodesResolver; @@ -43,9 +41,6 @@ import org.springframework.webflow.validation.WebFlowMessageCodesResolver; * Returns {@link ViewFactory view factories} that create native Spring MVC-based views. Used by a FlowBuilder to * configure a flow's view states with Spring MVC-based view factories. *

- * This implementation detects whether it is running in a Servlet or Portlet MVC environment, and returns instances of - * the default view factory implementation for that environment. - *

* By default, this implementation creates view factories that resolve their views by loading flow-relative resources, * such as .jsp templates located in a flow working directory. This class also supports rendering views resolved by * pre-existing Spring MVC {@link ViewResolver view resolvers}. @@ -57,9 +52,7 @@ import org.springframework.webflow.validation.WebFlowMessageCodesResolver; * @author Keith Donald * @author Scott Andrews */ -public class MvcViewFactoryCreator implements ViewFactoryCreator, ApplicationContextAware { - - private MvcEnvironment environment; +public class MvcViewFactoryCreator implements ViewFactoryCreator { private FlowViewResolver flowViewResolver = new FlowResourceFlowViewResolver(); @@ -162,11 +155,6 @@ public class MvcViewFactoryCreator implements ViewFactoryCreator, ApplicationCon this.messageCodesResolver = messageCodesResolver; } - // implementing ApplicationContextAware - - public void setApplicationContext(ApplicationContext applicationContext) { - environment = MvcEnvironment.environmentFor(applicationContext); - } public ViewFactory createViewFactory(Expression viewId, ExpressionParser expressionParser, ConversionService conversionService, BinderConfiguration binderConfiguration, @@ -188,17 +176,13 @@ public class MvcViewFactoryCreator implements ViewFactoryCreator, ApplicationCon } /** - * Creates a concrete instance of an AbstractMvcViewFactory according to the runtime environment (Servlet or - * Portlet). + * Creates a concrete instance of an AbstractMvcViewFactory. */ protected AbstractMvcViewFactory createMvcViewFactory(Expression viewId, ExpressionParser expressionParser, ConversionService conversionService, BinderConfiguration binderConfiguration) { - if (environment == MvcEnvironment.SERVLET) { - return new ServletMvcViewFactory(viewId, flowViewResolver, expressionParser, conversionService, - binderConfiguration, messageCodesResolver); - } else { - throw new IllegalStateException("Web MVC Environment " + environment + " not supported "); - } + + return new ServletMvcViewFactory(viewId, flowViewResolver, expressionParser, conversionService, + binderConfiguration, messageCodesResolver); } public String getViewIdByConvention(String viewStateId) { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java index b3b40807..8d80bb5e 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java @@ -60,7 +60,7 @@ import org.springframework.webflow.validation.ValidationHelper; import org.springframework.webflow.validation.ValidationHintResolver; /** - * Base view implementation for the Spring Web MVC Servlet and Spring Web MVC Portlet frameworks. + * Base view implementation for the Spring Web MVC Servlet frameworks. * * @author Keith Donald */ diff --git a/spring-webflow/src/main/java/org/springframework/webflow/test/execution/AbstractFlowExecutionTests.java b/spring-webflow/src/main/java/org/springframework/webflow/test/execution/AbstractFlowExecutionTests.java index 80ebc6ca..2e7340fb 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/test/execution/AbstractFlowExecutionTests.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/test/execution/AbstractFlowExecutionTests.java @@ -47,8 +47,8 @@ import org.springframework.webflow.test.MockExternalContext; *

* A flow execution test can effectively automate and validate the orchestration required to drive an end-to-end * business task that spans several steps involving the user to complete. Such tests are a good way to test your system - * top-down starting at the web-tier and pushing through all the way to the DB without having to deploy to a servlet or - * portlet container. In addition, they can be used to effectively test a flow's execution (the web layer) standalone, + * top-down starting at the web-tier and pushing through all the way to the DB without having to deploy to a servlet + * container. In addition, they can be used to effectively test a flow's execution (the web layer) standalone, * typically with a mock service layer. * * @author Keith Donald diff --git a/src/reference/index.xml b/src/reference/index.xml index b494ca6a..1cf1a24b 100644 --- a/src/reference/index.xml +++ b/src/reference/index.xml @@ -1,12 +1,9 @@ + xmlns="http://docbook.org/ns/docbook" version="5.0" + xmlns:xi="http://www.w3.org/2001/XInclude" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd"> Spring Web Flow Reference Guide @@ -96,9 +93,7 @@ - - diff --git a/src/reference/portlet.xml b/src/reference/portlet.xml deleted file mode 100644 index 53b18b19..00000000 --- a/src/reference/portlet.xml +++ /dev/null @@ -1,286 +0,0 @@ - - - Portlet Integration - - Introduction - - This chapter shows how to use Web Flow in a Portlet environment. - Spring Web Flow requires Portlet API 2.0 to run with. - The booking-portlet-mvc sample application is a good reference for using Web Flow within a portlet. - This application is a simplified travel site that allows users to search for and book hotel rooms. - - - - Configuring web.xml and portlet.xml - - The configuration for a portlet depends on the portlet container used. - The sample applications, included with Web Flow, are both configured to use Apache Pluto. - - - In general, the configuration requires adding a servlet mapping in the web.xml file to dispatch request to the portlet container. - - - swf-booking-mvc - org.apache.pluto.core.PortletServlet - - portlet-name - swf-booking-mvc - - 1 - - - - swf-booking-mvc - /PlutoInvoker/swf-booking-mvc - - ]]> - - The portlet.xml configuration is a standard portlet configuration. - The portlet-class needs to be set along with a pair of init-params. - Setting the expiration-cache to 0 is recommended to force Web Flow to always render a fresh view. - - - ... - org.springframework.web.portlet.DispatcherPortlet - - contextConfigLocation - /WEB-INF/web-application-config.xml - - - viewRendererUrl - /WEB-INF/servlet/view - - 0 - ... - - ]]> - - - Configuring Spring - - Flow Handlers - - The only supported mechanism for bridging a portlet request to Web Flow is a FlowHandler. - The PortletFlowController used in Web Flow 1.0 is no longer supported. - - - The flow handler, similar to the servlet flow handler, provides hooks that can: - - - select the flow to execute - - - pass input parameters to the flow on initialization - - - handle the flow execution outcome - - - handle exceptions - - - - - The AbstractFlowHandler class is an implementation of FlowHandler that provides default implementations for these hooks. - - - In a portlet environment the targeted flow id can not be inferred from the URL and must be defined explicitly in the handler. - - - - - Handler Mappings - - Spring Portlet MVC provides a rich set of methods to map portlet requests. - Complete documentation is available in the Spring Reference Documentation. - - - The booking-portlet-mvc sample application uses a PortletModeHandlerMapping to map portlet requests. - The sample application only supports view mode, but support for other portlet modes is available. - Other modes can be added and point to the same flow as view mode, or any other flow. - - - - - - - - - - - ]]> - - - Flow Handler Adapter - - A FlowHandlerAdapter converts the handler mappings to the flow handlers. - The flow executor is required as a constructor argument. - - - - - ]]> - - - - Portlet Views - - In order to facilitate view rendering, a ViewRendererServlet must be added to the web.xml file. - This servlet is not invoked directly, but it used by Web Flow to render views in a portlet environment. - - - ViewRendererServlet - org.springframework.web.servlet.ViewRendererServlet - - - - ViewRendererServlet - /WEB-INF/servlet/view - - ]]> - - - Portlet Modes and Window States - - Window State - - The Portlet API defined three window states: normal, minimized and maximized. - The portlet implementation must decide what to render for each of these window states. - Web Flow exposes the string value of the window state under portletWindowState via the request map on the external context. - - - - - - Portlet Mode - - The Portlet API defined three portlet modes: view, edit and help. - The portlet implementation must decide what to render for each of these modes. - Web Flow exposes the string value of the portlet mode under portletMode via the request map on the external context. - - - - - - - Using Portlets with JSF - - - Prior to version 2.1 of Spring Web Flow, support for JSF Portlets was considered - experimental and relied on a Portlet Bridge for JSF implementation. - Furthermore JSR-329 (the latest specification in this area), which targets - Portlet API 2.0 and JSF 1.2 environments at the time of writing is not yet - final causing portlet bridge implementations to also remain incomplete. - - - A closer comparison of Spring Web Flow and a Portlet Bridge for JSF shows - the two have significant overlap. They both drive the - JSF lifecycle and they both shield JSF from knowledge about Portlet action - and render requests. - - - Considering all of the above, starting with version 2.2, Spring Web Flow - provides support for JSF Portlets using its own internal Portlet integration rather - than a Portlet Bridge for JSF. We believe this will provide value for Web Flow users - by reducing the number of dependencies in what is already a fairly complex - combination of technologies with specifications lagging behind. - - - What this practically means is the configuration required for JSF Portlets is - very similar to what is alread documented in the rest of this chapter - with the exception of , which is not necessary - with JSF. - - - Review the swf-booking-portlet-faces sample in the Web Flow distribution - for a working JSF Portlets example with complete configuration details. The main - things to ensure are that the <faces:resources> elements is - included as part of your Spring configuration and that your - faces-config.xml configuration includes a PortletViewHandler: - - - - - - - - - org.springframework.faces.webflow.context.portlet.PortletViewHandler - - - -]]> - - The JSF Portlet support provided with Spring Web Flow requires JSF v2.0 or above. If - you are upgrading from a previous release you should ensure that your faces-config.xml - references org.springframework.faces.webflow.context.portlet.PortletViewHandler instead - of org.springframework.faces.webflow.application.portlet.PortletFaceletViewHandler. You - should also ensure that you have added <faces:resources> to you Spring configuration. - - - Although JSF v2.0 is a minimum requirement, this has been primarily driven to provide better support in - a Servlet environment. Many of the more advanced JSF 2.0 features (for example 'Partial State Saving') - are not supported by Spring Web Flow in a Portlet environment. - - - - - Issues in a Portlet Environment - - Redirects - - The Portlet API only allows redirects to be requested from an action request. - Because views are rendered on the render request, views and view-states cannot trigger a redirect. - - - The externalRedirect: view prefix is a convenience for Servlet based flows. - An IllegalStateException is thrown if a redirect is requested from a render request. - - - end-state redirects can be achieved by implementing FlowHandler.handleExecutionOutcome. - This callback provides the ActionResponse object which supports redirects. - - - - Switching Portlet Modes - - The portlet container passes the execution key from the previous flow when switching to a new mode. - Even if the mode is mapped to a different FlowHandler the flow execution will resume the previous execution. - You may switch the mode programatically in your FlowHandler after ending a flow in an ActionRequest. - - - One way to start a new flow is to create a URL targeting the mode without the execution key. - - - - diff --git a/src/reference/spring-faces.xml b/src/reference/spring-faces.xml index e1aa71bc..333baeef 100644 --- a/src/reference/spring-faces.xml +++ b/src/reference/spring-faces.xml @@ -23,10 +23,6 @@ xsi:schemaLocation=" JSF v2.0 or above. Both Sun Mojarra and Apache MyFaces runtime environments are supported. - Spring Web Flow also supports using JSF in a portlet environment. - Spring Web Flow's portlet integration supports Portlets API 2.0. - See for more on Spring Web Flow's portlet - integration. diff --git a/src/reference/upgrade-guide.xml b/src/reference/upgrade-guide.xml deleted file mode 100644 index c2627518..00000000 --- a/src/reference/upgrade-guide.xml +++ /dev/null @@ -1,278 +0,0 @@ - - - Upgrading from 1.0 - - Introduction - - This chapter shows you how to upgrade existing Web Flow 1 application to Web Flow 2. - - - - Flow Definition Language - - The core concepts behind the flow definition language have not changed between Web Flow 1 and 2. - However, some of the element and attribute names have changed. - These changes allow for the language to be both more concise and expressive. - A complete list of mapping changes is available as an appendix. - - - Flow Definition Updater Tool - - An automated tool is available to aid in the conversion of existing 1.x flows to the new 2.x style. - The tool will convert all the old tag names to their new equivalents, if needed. - While the tool will make a best effort attempt at conversion, there is not a one-to-one mapping for all version 1 concepts. - If the tool was unable to convert a portion of the flow, it will be marked with a WARNING comment in the resulting flow. - - - The conversion tool requires spring-webflow.jar, spring-core.jar and an XSLT 1.0 engine. - Saxon 6.5.5 is recommended. - - - The tool can be run from the command line with the following command. - Required libraries must be available on the classpath. - The source must be a single flow to convert. - The resulting converted flow will be sent to standard output. - - -java org.springframework.webflow.upgrade.WebFlowUpgrader flow-to-upgrade.xml - - - Flow Definition Updater Tool Warnings - - argument parameter-type no longer supported - - Bean actions have been deprecated in favor of EL based evaluate expressions. - The EL expression is able to accept method parameters directly, so there is no longer a need for the argument tag. - A side effect of this change is that method arguments must be of the correct type before invoking the action. - - - - inline-flow is no longer supported - - Inline flows are no longer supported. - The contents of the inline flow must be moved into a new top-level flow. - The inline flow's content has been converted for your convenience. - - - - mapping target-collection is no longer supported - - Output mappings can no longer add an item to a collection. - Only assignment is supported. - - - - var bean is no longer supported - - The var bean attribute is no longer needed. - All spring beans can be resolved via EL. - - - - var scope is no longer supported - - The var element will place all variable into flow scope. - Conversation scope was previously allowed. - - - - - - EL Expressions - - EL expressions are used heavily throughout the flow definition language. - Many of the attributes that appear to be plain text are actually interpreted as EL. - The standard EL delimiters (either ${} or #{} in Web Flow 2.0 or just #{} in Web Flow 2.1) are not necessary and will often cause an exception if they are included. - - - EL delimiters should be removed where necessary by the updater tool. - - - - - Web Flow Configuration - - In Web Flow 1 there were two options available for configuring Web Flow, one using standard spring bean XML and the other using the webflow-config-1.0 schema. - The schema configuration option simplifies the configuration process by keeping long internal class names hidden and enabling contextual auto-complete. - The schema configuration option is the only way to configure Web Flow 2. - - - Web Flow Bean Configuration - - The FactoryBean bean XML configuration method used in Web Flow 1 is no longer supported. - The schema configuration method should be used instead. - In particular beans defining FlowExecutorFactoryBean and XmlFlowRegistryFactoryBean should be updated. - Continue reading Web Flow Schema Configuration for details. - - - - Web Flow Schema Configuration - - The webflow-config configuration schema has also changed slightly from version 1 to 2. - The simplest way to update your application is modify the version of the schema to 2.0 then fix any errors in a schema aware XML editor. - The most common change is add 'flow-' to the beginning of the elements defined by the schema. - - - ]]> - - flow-executor - - The flow executor is the core Web Flow configuration element. - This element replaces previous FlowExecutorFactoryBean bean definitions. - - - ]]> - - - flow-execution-listeners - - Flow execution listeners are also defined in the flow executor. - Listeners are defined using standard bean definitions and added by reference. - - - - - - - - - ]]> - - - flow-registry - - The flow-registry contains a set of flow-locations. - Every flow definition used by Web Flow must be added to the registry. - This element replaces previous XmlFlowRegistryFactoryBean bean definitions. - - - - - ]]> - - - - Flow Controller - - The package name for flow controllers has changed from org.springframework.webflow.executor.mvc.FlowController and is now org.springframework.webflow.mvc.servlet.FlowController for Servlet MVC requests. - The portlet flow controller org.springframework.webflow.executor.mvc.PortletFlowController has been replaced by a flow handler adapter available at org.springframework.webflow.mvc.portlet.FlowHandlerAdapter. - They will need to be updated in the bean definitions. - - - - Flow URL Handler - - The default URL handler has changed in Web Flow 2. - The flow identifier is now derived from the URL rather then passed explicitly. - In order to maintain comparability with existing views and URL structures a WebFlow1FlowUrlHandler is available. - - - - - - - - ]]> - - - View Resolution - - Web Flow 2 by default will both select and render views. - View were previously selected by Web Flow 1 and then rendered by an external view resolver. - - - In order for version 1 flows to work in Web Flow 2 the default view resolver must be overridden. - A common use case is to use Apache Tiles for view resolution. - The following configuration will replace the default view resolver with a Tiles view resolver. - The tilesViewResolver in this example can be replaced with any other view resolver. - - - - ... - - - - - - - - - - - - - - - - ]]> - - - - New Web Flow Concepts - - Automatic Model Binding - - Web Flow 1 required Spring MVC based flows to manually call FormAction methods, notably: - setupForm, bindAndValidate to process form views. - Web Flow 2 now provides automatic model setup and binding using the model attribute for view-states. - Please see the Binding to a Model section for details. - - - - OGNL vs Spring EL - - Web Flow 1 used OGNL exclusively for expressions within the flow definitions. - Web Flow 2 adds support for Unified EL. - Web Flow 2.1 uses Spring EL by default. - United EL and OGNL can still be plugged in. - Please see for details. - - - - Flash Scope - - Flash scope in Web Flow 1 lived across the current request and into the next request. - This was conceptually similar to Web Flow 2's view scope concept, but the semantics were not as well defined. - In Web Flow 2, flash scope is cleared after every view render. - This makes flashScope semantics in Web Flow consistent with other web frameworks. - - - - JSF - - Web Flow 2 offers significantly improved integration with JSF. - Please see for details. - - - - External Redirects - - External redirects in Web Flow 1 were always considered context relative. - In Web Flow 2, if the redirect URL begins with a slash, it is considered servlet-relative instead of context-relative. - URLs without a leading slash are still context relative. - - - - diff --git a/src/reference/whatsnew.xml b/src/reference/whatsnew.xml index c555089c..5f41505f 100644 --- a/src/reference/whatsnew.xml +++ b/src/reference/whatsnew.xml @@ -77,9 +77,6 @@ Upgraded projects will need to ensure that the <faces:resources> elements is included as part of their Spring configuration. - - See . - Deprecations @@ -97,83 +94,4 @@ - - Spring Web Flow 2.3 - - Embedding A Flow On A Page - - By default Web Flow does a client-side redirect upon entering every view state. - That makes it impossible to embed a flow on a page or within a modal dialog and execute more than one view state without causing a full-page refresh. - Web Flow now supports launching a flow in "embedded" mode. - In this mode a flow can transition to other view states without a client-side redirect during Ajax requests. - See and . - - - - Support For JSR-303 Bean Validation - - Support for the JSR-303 Bean Validation API is now available building on equivalent support available in Spring MVC. - See for more details. - - - - Flow-Managed Persistence Context Propagation - - Starting with Web Flow 2.3 a flow managed PersistenceContext is automatically extended (propagated) to sub-flows assuming the subflow also has the feature enabled as well. - See . - - - - Portlet 2.0 Resource Requests - - Support for Portlet 2.0 resource requests has now been added enabling Ajax requests with partial rendering. - URLs for such requests can be prepared with the <portlet:resourceURL> tag in JSP pages. - Server-side processing is similar to a combined an action and a render requests but combined in a single request. - Unlike a render request, the response from a resource request includes content from the target portlet only. - - - - Custom ConversationManager - - The <flow-execution-repository> element now provides a conversation-manager attribute accepting a reference to a ConversationManager instance. - - - - Redirect In Same State - - By default Web Flow does a client-side redirect when remaining in the same view state as long as the current request is not an Ajax request. - This is useful after form validation failure. - Hitting Refresh or Back won't result in browser warnings. - Hence this behavior is usually desirable. - However a new flow execution attribute makes it possible to disable it and that may also be necessary in some cases specific to JSF applications. - See . - - - - Samples - - The process for building the samples included with the distribution has been simplified. - Maven can be used to build all samples in one step. - Eclipse settings include source code references to simplify debugging. - - - Additional samples can be accessed as follows: -mkdir spring-samples -cd spring-samples -svn co https://src.springframework.org/svn/spring-samples/webflow-primefaces-showcase -cd webflow-primefaces-showcase -mvn package -# import into Eclipse - - -mkdir spring-samples -cd spring-samples -svn co https://src.springframework.org/svn/spring-samples/webflow-showcase -cd webflow-showcase -mvn package -# import into Eclipse - - - -