Forums de discussion

Liferay not compliant with Portlet spec 2.0?

thumbnail
Hubert Vogten, modifié il y a 15 années.

Liferay not compliant with Portlet spec 2.0?

New Member Publications: 11 Date d'inscription: 02/12/08 Publications récentes
We are trying to implementing a portlet filter to modify the response. For this purpose we extended a RenderResponseWrapper class that deals with the transformation. However, when we use this class the PortletRequestDispatcher uses the original Response object, instead of our wrapper via the getResponse() method. To circumvent this we returned the wrapper itself via the getResponse(). However, this leads to a stack overflow as the PortletResponseImpl class only searches for PortletResponseImpl instances.

So we think the PortletRequestDispatcher should only use the methods from the PortletResponse interface instead of the PortletResponseImpl . Because according to the Portlet 2.0 spec in the section "PLT.20.2.2 Wrapping Requests and Responses" it specifically states:

"Central to the notion of filtering is the concept of wrapping a request or response in order
that it can override behavior to perform a filtering task. In this model, the developer has
the ability to override existing methods on the request and response objects. The portlet
should not add additional methods to the wrapper as further downstream wrappers may
not honor these. In order to support this style of filter the container must support the
following requirement. When a filter invokes the doFilter method on the portlet
container’s filter chain implementation, the container must ensure that the request and
response object that it passes to the next component in the filter chain, or to the target
portlet if the filter was the last in the chain, is the same object that was passed into the
doFilter method by the calling filter or one of the above mentioned wrappers."


So, is this a bug or did we miss something?
Martijn Res, modifié il y a 14 années.

RE: Liferay not compliant with Portlet spec 2.0?

New Member Publications: 2 Date d'inscription: 04/02/10 Publications récentes
Hi,

I also think that Liferay 5.2.3 is not compliant to JSR 286 regarding the possibility to wrap the RenderRequest and RenderResponse with the designated wrappers.

This notion and its logical consequences are, to my opinion, completely lacking. For instance, the "javax.portlet.request" and "javax.portlet.response" request properties should give the wrappers around request and response, not the PortletRequestImpl and PortletResponseImpl themselves.

Is there (if I'm not misinterpreting 286) any change that this compliance will be included in 6.0?

PS: I also posted an issue about this (http://issues.liferay.com/browse/LPS-7600), because I'm rather new in this community, and I'm not sure where to get attention for this :-)
thumbnail
Michael Young, modifié il y a 12 années.

RE: Liferay not compliant with Portlet spec 2.0?

Liferay Master Publications: 846 Date d'inscription: 05/08/04 Publications récentes
This issue has been fixed, see http://issues.liferay.com/browse/LPS-17363
Martijn Res, modifié il y a 12 années.

RE: Liferay not compliant with Portlet spec 2.0?

New Member Publications: 2 Date d'inscription: 04/02/10 Publications récentes
In the current nightly build (25-08-2011), ResourceRequest wrapping does not work, because of the class com.liferay.portal.action.LayoutAction:

java.lang.ClassCastException: nl.virgil.fp.portlet.FPPortletResourceRequest cannot be cast to com.liferay.portlet.PortletRequestImpl
com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:705)
com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:243)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:172)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:540)
com.liferay.portal.servlet.MainServlet.service(MainServlet.java:517)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...

Can/should I (re)open a Jira issue for this?

BTW, I downloaded the source code of the nightly as well, but the class is not in there.