0 Replies Latest reply on Mar 10, 2008 11:28 AM by Armin Vogt

    "sendRedirect cannot be called after " with new portletbridg

    Armin Vogt Newbie

      I get the following exception with the new portletbridge 1.0.0.B

      16:18:50,797 ERROR [STDERR] java.lang.IllegalStateException: sendRedirect cannot be called after setPortletMode/setWindowState/set
      RenderParameter/setRenderParameters has been called previously
      16:18:50,797 ERROR [STDERR] at org.jboss.portal.portlet.impl.jsr168.api.ActionResponseImpl.sendRedirect(ActionResponseImpl.jav
      a:153)


      I tried to figure out why:
      The portletbridge caused a setRenderParameter(..) call that prevents the redirect. It sets the parameter javax.faces.portletbridge.STATE_ID

      Daemon Thread [http-localhost%2F127.0.0.1-8080-2] (Suspended (breakpoint at line 177 in ActionResponseImpl))
      JBossActionResponse(ActionResponseImpl).setRenderParameter(String, String) line: 177
       PortletStateHolder.getStateId(FacesContext) line: 247
       PortletStateHolder.getWindowState(FacesContext) line: 164
       AjaxPortletBridge.doFacesRequest(ActionRequest, ActionResponse) line: 140
       GenericFacesPortlet.processAction(ActionRequest, ActionResponse) line: 165


      If I patch the JBossActionResponse class I'd get around the illegal state.

      Armin
      Is there a legal way to allow a redirect during a JSF commandbutton action?