0 Replies Latest reply on Aug 8, 2006 11:38 PM by Peter Johnson

    setPortalMode not working

    Peter Johnson Master

      I have a portlet implemented using JSPs. I would like, when the edit mode is displayed, when the user clicks the Submit button on the edit page, that the view page of the portlet gets displayed. I tried using the PortletURL.setPortletMode() method, which is supposed to add a mode change parameter to the URL, but that is not working (I did check the URL generated and it appears to be correct with a "mode=edit" parameter), the edit page is displayed again.

      Here is what is in my doEdit method:

      PortletURL urlSubmit = response.createActionURL();
      request.setAttribute("submit", urlSubmit.toString());

      And in my JSP I have:

      <form action="${submit}" method="post">

      According to the log, the URL is:


      I looked at the source for GenericPortlet.doDispatch, which lead me to PortletRequestImpl.getPortletMode, which appears to be getting the current mode from the context. Unless the context was supposed to be changed earlier as part of the request processing, shouldn't PortletRequestImpl check if the mode appears among the requests parameters?

      JBoss AS 4.0.4.GA, JBoss Portal 2.4.0.CR3, Sun JDK 1.5.0_06