How to get HttpServletRequest in JSR 168/286 portlets as it does not extend Servlets?

0 comments



Getting HttpServletRequest is very easy on JSR 168/ 286 portlets although that is not recommended because portlet itself provides PortletRequest that contains most of the attributes that HttpServletRequest contains.

In doview() method, use the below code

HttpServletRequest httpServletRequest = (HttpServletRequest) (com.ibm.ws.portletcontainer.portlet.PortletUtils.getHttpServletRequest(renderRequest));

No comments:

Post a Comment

Recent Posts

Popular Posts

© 2011-2019 Web Portal Club