javaservletsportletjsr286

Portal-container neutral method to obtain httpservletrequest from portlet request


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


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.