Question

Is there a way, using only the standard oracle JSR-286 classes, to obtain the HttpServletRequest behind a portlet request? Here is the liferay-specific method

HttpServletRequest httpRequest =
  PortalUtil.getOriginalServletRequest(
    PortalUtil.getHttpServletRequest(portletRenderRequest));

Many thanks in advance

Was it helpful?

Solution

To directly answer your question, I would try using the solution from Vamshi provided here. I think that solution still may be portlet container specific since I don't see any mention of this in the JSR-286 specification. I myself have only used a container specific solutions to this.

In a more general discussion I would direct you to Why is the servlet request not available in the portlet API Portlets are not servlets, so make sure you're not trying to use them in that way.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top