ICEfaces
  1. ICEfaces
  2. ICE-2247

"javax.portlet.response" request attribute is not passed to externalContext in portlet environment

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7DR#1
    • Fix Version/s: 1.7DR#3, 1.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      JBoss 4.2.1, Liferay 4.3.2, Sun RI 1.2 (Embedded in JBoss), Facelets (ICE Faces Implementation)

      Description

      Portlet specification (sec. 16.3.2) determines that PortletRequestDispatcher must add "javax.portlet.response" including another Servlet or JSP.

      Such an include is done in com.icesoft.faces.webapp.http.portlet.MainPortlet and PortletRequestDispatcher adds corresponding attribut to a request - this attribut is presented in the request passed to the service method of com.icesoft.faces.webapp.http.servlet.MainServlet.

      But than this attribute is lost somewhere. I can't get it in my portlet code using facesContext.getExternalContext().getRequestMap().getAttribute("javax.portlet.response").

      It is rather important to have such an attribute since it allows to construct direct URL to the portlet and some page inside a portlet (using renderResponse.createRenderURL).

        Activity

        Hide
        Neil Griffin added a comment -

        Correction – the only one Mircea took out was Constants.LIFERAY_THEME_DISPLAY

        When I put the following in web.xml:

        <context-param>
        <param-name>com.icesoft.faces.hiddenPortletAttributes</param-name>
        <param-value>THEME_DISPLAY</param-value>
        </context-param>

        it worked great.

        Thanks,

        Neil

        Show
        Neil Griffin added a comment - Correction – the only one Mircea took out was Constants.LIFERAY_THEME_DISPLAY When I put the following in web.xml: <context-param> <param-name>com.icesoft.faces.hiddenPortletAttributes</param-name> <param-value>THEME_DISPLAY</param-value> </context-param> it worked great. Thanks, Neil
        Hide
        Neil Griffin added a comment -

        Fixed in Liferay trunk on 12/1/2007:
        http://support.liferay.com/browse/LEP-3845

        This will be fixed in Liferay 4.4 and possibly backported to Liferay 4.3.5

        Show
        Neil Griffin added a comment - Fixed in Liferay trunk on 12/1/2007: http://support.liferay.com/browse/LEP-3845 This will be fixed in Liferay 4.4 and possibly backported to Liferay 4.3.5
        Hide
        Neil Griffin added a comment -

        After committing the fix, the JSR-168 TCK tests broke. So I asked bchan to backout all the fixes in Liferay.

        As documented in LEP-3845, moving forward the best solution is to use Mircea's new web.xml feature:

        <context-param>
        <param-name>com.icesoft.faces.hiddenPortletAttributes</param-name>
        <param-value>javax.portlet.config,javax.portlet.userinfo,THEME_DISPLAY</param-value>
        </context-param>

        This of course means that you have to use ICEfaces 1.7 DR#3 or newer.

        Show
        Neil Griffin added a comment - After committing the fix, the JSR-168 TCK tests broke. So I asked bchan to backout all the fixes in Liferay. As documented in LEP-3845, moving forward the best solution is to use Mircea's new web.xml feature: <context-param> <param-name>com.icesoft.faces.hiddenPortletAttributes</param-name> <param-value>javax.portlet.config,javax.portlet.userinfo,THEME_DISPLAY</param-value> </context-param> This of course means that you have to use ICEfaces 1.7 DR#3 or newer.
        Hide
        Deryk Sinotte added a comment -

        Resolving as fixed.

        My tests now indicate that this works as advertised in our upcoming documentation. Standard attributes from the specification (e.g. javax.portlet.request) are now properly maintained and exposed via the request Map:

        FacesContext facesContext = FacesContext.getCurrentInstance();
        ExternalContext exContext = facesContext.getExternalContext();
        Map reqMap = exContext.getRequestMap();

        Custom attributes (e.g. Liferay's THEME_DISPLAY) can now be added into the web.xml via a customer context-parameter so that they can be maintained as well:

        <context-param>
        <param-name>com.icesoft.faces.hiddenPortletAttributes</param-name>
        <param-value>THEME_DISPLAY</param-value>
        </context-param>

        Show
        Deryk Sinotte added a comment - Resolving as fixed. My tests now indicate that this works as advertised in our upcoming documentation. Standard attributes from the specification (e.g. javax.portlet.request) are now properly maintained and exposed via the request Map: FacesContext facesContext = FacesContext.getCurrentInstance(); ExternalContext exContext = facesContext.getExternalContext(); Map reqMap = exContext.getRequestMap(); Custom attributes (e.g. Liferay's THEME_DISPLAY) can now be added into the web.xml via a customer context-parameter so that they can be maintained as well: <context-param> <param-name>com.icesoft.faces.hiddenPortletAttributes</param-name> <param-value>THEME_DISPLAY</param-value> </context-param>
        Hide
        Aaron Lucas added a comment -

        I have a problem with the documentation and the comment above.

        The values for the hiddenPortletAttributes are shown to be separated by commas, yet if you look at the source they are split on spaces:

        Collection hiddenCustomAttributeNames = Arrays.asList(customPortletAttributes.split(" "));

        I am taking that it should be spaces to work now but I would suggest using another delimiter instead, just as you suggest a comma and then update the source to reflect this change.

        Collection hiddenCustomAttributeNames = Arrays.asList(customPortletAttributes.split(","));

        Show
        Aaron Lucas added a comment - I have a problem with the documentation and the comment above. The values for the hiddenPortletAttributes are shown to be separated by commas, yet if you look at the source they are split on spaces: Collection hiddenCustomAttributeNames = Arrays.asList(customPortletAttributes.split(" ")); I am taking that it should be spaces to work now but I would suggest using another delimiter instead, just as you suggest a comma and then update the source to reflect this change. Collection hiddenCustomAttributeNames = Arrays.asList(customPortletAttributes.split(","));

          People

          • Assignee:
            Unassigned
            Reporter:
            Vadim Lotarev
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: