Description
The Struts Bridge can be used from within a web application as well as a portlet application context (even concurrently).
To determine in what context it is operating, the StrutsServlet provides a static boolean isPortletRequest(ServletRequest) method which
checks if a "javax.portlet.request" request attribute is set.
This is based on Portlet API specification PLT.16.3.2. But, that only applies to RenderRequest events as the Portlet API doesn't
formally support servlet invocation from an ActionRequest as the Struts Bridge does.
In GridSphere, this resulted in a problem because its JSR-168 container only sets the "javax.portlet.request" attribute (as well as the others)
during the RenderRequest event.
Note: the Apache Jetspeed-2 portal does set these attributes also during an ActionRequest event.
After some discussion on the bridges-dev mailing list with Jason Novotny from GridSphere (who reported this problem)
and Stefan Hepper which is on the JCP team for the JSR-168, we agreed upon the following solution:
The StrutsPortlet will set the servlet request attributes as described in PLT.16.3.2 itself if they haven't been set already and (only) when invoked
from an ActionRequest.
Struts Portlet Applications can thus rely on these attributes to be set in all situations and there is still no additional requirement for portlet containers
beyond the JSR-168 specification.