spring-projects / spring-webflow

Spring Web Flow
https://spring.io/projects/spring-webflow
Apache License 2.0
331 stars 233 forks source link

FlowHandler.handleExecutionOutcome sendRedirect not working for mvc portlet for external redirect [SWF-1551] #734

Closed spring-operator closed 4 weeks ago

spring-operator commented 12 years ago

kaushal desai opened SWF-1551 and commented

This is related to #1531, where the suggestion is to override FlowHandler.handleExecutionOutcome method and use ActionResponse.sendRedirect for end-state.

When same is implemented, following exception stack trace is generated:

00000611 SystemErr     R java.lang.IllegalStateException: Can't invoke sendRedirect() after certain methods have been called
[6/14/12 7:06:58:421 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.core.impl.ActionResponseImpl.sendRedirect(ActionResponseImpl.java:144)
[6/14/12 7:06:58:421 EST] 00000611 SystemErr     R  at com.test.web.spring.handler.MyFlowHandler.handleExecutionOutcome(MyFlowHandler.java:22)
[6/14/12 7:06:58:421 EST] 00000611 SystemErr     R  at org.springframework.webflow.mvc.portlet.FlowHandlerAdapter.handleFlowExecutionOutcome(FlowHandlerAdapter.java:279)
[6/14/12 7:06:58:421 EST] 00000611 SystemErr     R  at org.springframework.webflow.mvc.portlet.FlowHandlerAdapter.handleAction(FlowHandlerAdapter.java:170)
[6/14/12 7:06:58:421 EST] 00000611 SystemErr     R  at org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:641)
[6/14/12 7:06:58:421 EST] 00000611 SystemErr     R  at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:519)
[6/14/12 7:06:58:421 EST] 00000611 SystemErr     R  at org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:460)
[6/14/12 7:06:58:422 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletFilterChainImpl.doFilter(PortletFilterChainImpl.java:77)
[6/14/12 7:06:58:422 EST] 00000611 SystemErr     R  at com.ibm.wps.propertybroker.standard.filter.PropertyBrokerActionFilter.doFilter(PropertyBrokerActionFilter.java:731)
[6/14/12 7:06:58:422 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletFilterChainImpl.doFilter(PortletFilterChainImpl.java:69)
[6/14/12 7:06:58:422 EST] 00000611 SystemErr     R  at com.ibm.wps.propertybroker.standard.filter.C2APortletFilter.doFilter(C2APortletFilter.java:166)
[6/14/12 7:06:58:422 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletFilterChainImpl.doFilter(PortletFilterChainImpl.java:69)
[6/14/12 7:06:58:422 EST] 00000611 SystemErr     R  at com.ibm.wps.engine.dpr.portlet.impl.ProcessActionMemoFilter.doFilter(ProcessActionMemoFilter.java:88)
[6/14/12 7:06:58:422 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletFilterChainImpl.doFilter(PortletFilterChainImpl.java:69)
[6/14/12 7:06:58:422 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServlet.doDispatch(PortletServlet.java:527)
[6/14/12 7:06:58:422 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:114)
[6/14/12 7:06:58:422 EST] 00000611 SystemErr     R  at com.ibm.isclite.container.collaborator.PortletServletCollaborator.doAction(PortletServletCollaborator.java:56)
[6/14/12 7:06:58:422 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:101)
[6/14/12 7:06:58:422 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.rrd.RRDServerPortletServletCollaborator.doAction(RRDServerPortletServletCollaborator.java:117)
[6/14/12 7:06:58:423 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:101)
[6/14/12 7:06:58:423 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.cache.CacheCollaborator.doAction(CacheCollaborator.java:84)
[6/14/12 7:06:58:423 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:101)
[6/14/12 7:06:58:423 EST] 00000611 SystemErr     R  at com.ibm.wps.pe.pc.waspc.core.impl.PortletServletCollaboratorImpl.doAction(PortletServletCollaboratorImpl.java:146)
[6/14/12 7:06:58:423 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:101)
[6/14/12 7:06:58:423 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServlet.doDispatch(PortletServlet.java:301)
[6/14/12 7:06:58:423 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:82)
[6/14/12 7:06:58:423 EST] 00000611 SystemErr     R  at com.ibm.isclite.container.collaborator.PortletServletCollaborator.doDispatch(PortletServletCollaborator.java:124)
[6/14/12 7:06:58:423 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:74)
[6/14/12 7:06:58:423 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.rrd.RRDServerPortletServletCollaborator.doDispatch(RRDServerPortletServletCollaborator.java:60)
[6/14/12 7:06:58:423 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:74)
[6/14/12 7:06:58:424 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.cache.CacheCollaborator.doDispatch(CacheCollaborator.java:74)
[6/14/12 7:06:58:424 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:74)
[6/14/12 7:06:58:424 EST] 00000611 SystemErr     R  at com.ibm.wps.pe.pc.waspc.core.impl.PortletServletCollaboratorImpl.doDispatch(PortletServletCollaboratorImpl.java:121)
[6/14/12 7:06:58:424 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:74)
[6/14/12 7:06:58:424 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServlet.dispatch(PortletServlet.java:208)
[6/14/12 7:06:58:424 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletServlet.service(PortletServlet.java:165)
[6/14/12 7:06:58:424 EST] 00000611 SystemErr     R  at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
[6/14/12 7:06:58:424 EST] 00000611 SystemErr     R  at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1146)
[6/14/12 7:06:58:424 EST] 00000611 SystemErr     R  at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1087)
[6/14/12 7:06:58:424 EST] 00000611 SystemErr     R  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
[6/14/12 7:06:58:424 EST] 00000611 SystemErr     R  at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
[6/14/12 7:06:58:425 EST] 00000611 SystemErr     R  at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:837)
[6/14/12 7:06:58:425 EST] 00000611 SystemErr     R  at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:680)
[6/14/12 7:06:58:425 EST] 00000611 SystemErr     R  at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:588)
[6/14/12 7:06:58:425 EST] 00000611 SystemErr     R  at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:524)
[6/14/12 7:06:58:425 EST] 00000611 SystemErr     R  at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
[6/14/12 7:06:58:425 EST] 00000611 SystemErr     R  at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:639)
[6/14/12 7:06:58:425 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:235)
[6/14/12 7:06:58:425 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.invoker.impl.PortletInvokerCollaboratorChainImpl.doCollaborator(PortletInvokerCollaboratorChainImpl.java:76)
[6/14/12 7:06:58:425 EST] 00000611 SystemErr     R  at com.ibm.ws.portletcontainer.cache.PortletInvokerCacheCollaborator.doAction(PortletInvokerCacheCollaborator.java:50)

Affects: 2.3.1

spring-operator commented 12 years ago

Rossen Stoyanchev commented

The booking-portlet-mvc samples doesn't do a redirect but you can experiment. It would be useful if you could isolate whether the issue is linked to Web Flow or your portlet container. For example does it work in Apache Pluto or other you can try with? Have you tried redirecting in your own portlet container without Web Flow?