ICEfaces
  1. ICEfaces
  2. ICE-2381

Liferay does not provide all request attributes via getAttributeNames()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7DR#2
    • Fix Version/s: 1.7DR#3, 1.7
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Liferay 4.3.*
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)

      Description

      Due to the way that ICEfaces handles long-lived requests, it is necessary for the framework to make copies of the information (parameters, attributes, etc) contained in a request instance. The request instance (PortletRequest,HttpServletRequest) supports two methods for getting attributes: getAttribute(String name) and getAttributeNames(). For our copying purposes, ICEfaces typically uses the getAttributeNames() method and iterates over the names to copy the values into its own internal storage.

      The problem is that getAttributeNames() does not return some of the values that can be retrieved via the getAttribute(String name) method. This problem seems specific to Liferay and they have said they are working on it for a future release but we haven't tested all the values on all portal platforms yet. JBoss appears to work as it should from some brief testing. The first attributes are the javax.servlet.include* attributes outlined in the Portlet 1.0 spec (JSR 168) which are required to be set when using a request dispatcher:

         javax.servlet.include.context_path
         javax.servlet.include.path_info
         javax.servlet.include.query_string
         javax.servlet.include.request_uri
         javax.servlet.include.servlet_path

      Other specified attributes that must be available are prefixed with javax.portlet.*. They return objects of the corresponding types rather than Strings:

         javax.portlet.config
         javax.portlet.request
         javax.portlet.response

      Additionally, there is an attribute specified by the PortletRequest.USER_INFO constant (= javax.portlet.userinfo) which can be used to extract a map of user information values.

      And lastly, there are custom values that Liferay sets. I have no idea what the scope of these are but we've had a request for a least one:

         THEME_DISPLAY

      There are a couple of JIRA cases related to request attributes that may be useful for reference (ICE-2247, ICE-2293) as we've attempted a partial fix - basically copying in some subset of of the attributes that we know about or we know they have asked for. However, because these request attributes are added in on the server side, they are not properly handled in standardRequest mode which cleans out the entire attribute map with each request. The case for that problem is ICE-2369.

      So what we need to do is:

      1) Ensure that these attributes are manually added when copying request information
      2) Ensure that they are maintained between Ajax requests when standardRequest mode is on
      3) Perhaps provide some mechanism for developers to dynamically add additional custom attributes (via web.xml for example) like THEME_DISPLAY as we cannot know the number or extent of these attributes

        Issue Links

          Activity

          Hide
          Neil Griffin added a comment -

          See ICE-2247 for more details on how to implement this in Liferay.

          Show
          Neil Griffin added a comment - See ICE-2247 for more details on how to implement this in Liferay.
          Hide
          Mircea Toma added a comment -

          Custom hidden request attribute names can be specified as space separated strings in 'com.icesoft.faces.hiddenPortletAttributes' context parameter.

          Show
          Mircea Toma added a comment - Custom hidden request attribute names can be specified as space separated strings in 'com.icesoft.faces.hiddenPortletAttributes' context parameter.
          Hide
          Mircea Toma added a comment -

          Propagate hidden and custom attributes in the request maps.

          Show
          Mircea Toma added a comment - Propagate hidden and custom attributes in the request maps.
          Hide
          Deryk Sinotte added a comment -

          Assigning to Mircea as part of the general request attribute refactoring he is doing.

          Show
          Deryk Sinotte added a comment - Assigning to Mircea as part of the general request attribute refactoring he is doing.

            People

            • Assignee:
              Unassigned
              Reporter:
              Deryk Sinotte
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: