Details
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
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 (
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
- depends on
-
ICE-2383 Refactor/simplify ExternalContext implementations
- Closed
See
ICE-2247for more details on how to implement this in Liferay.