portletspec3
  1. portletspec3
  2. PORTLETSPEC3-24

GenericPortlet.doHeaders(RenderRequest, RenderResponse) should throw javax.portlet.PortletException

    Details

      Description

      In order for a JSF 2 portlet to work in a streaming portal, the JSF lifecycle must be run from the GenericPortlet.doHeaders(RenderRequest, RenderResponse) method in order to determine the JSF 2 <script> and <link> resources that are to be included in the <head>...</head> section of the rendered portal page.

      Unfortunately the signature for GenericPortlet.doHeaders(RenderRequest, RenderResponse) does not throw an exception, so if there is a problem running the JSF lifecycle, there is no way report any exceptions other than by printing the stacktrace or throwing a RuntimeException.

        Activity

        Hide
        msnicklous added a comment -

        Resolved this by adding IOException and PortletException to the method signature. The method doHeaders() now has the same documented exceptions as the related doDispatch(), doView(), doHelp(), and doEdit() methods that can be called during render() processing.

        Also corrected a number of typos and missing/falsely named closing HTML tags that were adversely affecting the javadoc page formatting for the GenericPortlet class.

        Show
        msnicklous added a comment - Resolved this by adding IOException and PortletException to the method signature. The method doHeaders() now has the same documented exceptions as the related doDispatch(), doView(), doHelp(), and doEdit() methods that can be called during render() processing. Also corrected a number of typos and missing/falsely named closing HTML tags that were adversely affecting the javadoc page formatting for the GenericPortlet class.
        Hide
        msnicklous added a comment -

        I think we should talk about this one again. I got feedback that adding "throws IOException, PortletException" to the GenericPortlet.doHeaders(RenderRequest, RenderResponse) method would be an incompatible change that would break existing portlets (binary incompatibility). We probably shouldn't do that.

        As an alternative, we might want to introduce a new method with a different signature like maybe:

        GenericPortlet.doHeaders(HeaderRequest, HeaderResponse) throws IOException, PortletException

        to accomplish the goal of allowing exceptions to be thrown.

        Show
        msnicklous added a comment - I think we should talk about this one again. I got feedback that adding "throws IOException, PortletException" to the GenericPortlet.doHeaders(RenderRequest, RenderResponse) method would be an incompatible change that would break existing portlets (binary incompatibility). We probably shouldn't do that. As an alternative, we might want to introduce a new method with a different signature like maybe: GenericPortlet.doHeaders(HeaderRequest, HeaderResponse) throws IOException, PortletException to accomplish the goal of allowing exceptions to be thrown.
        Hide
        msnicklous added a comment -

        Fixed by introducing a new header phase that is executed before the portlet is rendered. See spec Section 3.7 Portlet Request Processing Phases. See javadoc describing the HeaderPortlet interface.

        Show
        msnicklous added a comment - Fixed by introducing a new header phase that is executed before the portlet is rendered. See spec Section 3.7 Portlet Request Processing Phases. See javadoc describing the HeaderPortlet interface.

          People

          • Assignee:
            msnicklous
            Reporter:
            Neil Griffin
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: