Evert Lammerts wrote:
Hi list,

Using the Apache struts bridge (within the Liferay 5.1.2 portlet container on Tomcat 6.0), how can I distinguish the phase of the request in my Action class? Iow, when does the javax.portlet.request attribute of the ServletRequest contain a RenderRequest, and when does it contain an ActionRequest? I keep getting cast exceptions here:

ActionRequest aReq = (ActionRequest) req.getAttribute("javax.portlet.request");

  if 
(req.getAttribute(StrutsPortlet.REQUEST_TYPE).equals(StrutsPortlet.ACTION_REQUEST))
 {
    ActionRequest aReq = 
(ActionRequest).req.getAttribute("javax.portlet.request");
  }
  else {
    RenderRequest rReq = 
(RenderRequest).req.getAttribute("javax.portlet.request");
  }

Note: the above assumes JSR-168., not yet JSR-286 interactions.

JSR-286 Portlet 2.0 adds req.getAttribute(PortletRequest.LIFECYCLE_PHASE) as a 
standardization of the above.

HTH,

Ate


Best,

Evert Lammerts

Evert Lammerts

SARA Computing & Network Services

High Performance Computing & Visualization

Phone: +31 20 888 4101

Email: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to