Saturday, November 9, 2013

How to get HttpServletRequest and HttpServletResponse from JSF Portlet context in Liferay

// get PortletRequest from JSF Portlet context
PortletRequest portletRequest = (PortletRequest) FacesContext

// convert the PortletRequest object to HttpServletRequest object
HttpServletRequest servletRequest = PortalUtil

// get PortletResponse from JSF Portlet context
PortletResponse portletResponse = (PortletResponse) FacesContext

// convert PortletResponse object to HttpServletResponse object
HttpServletResponse servletResponse = PortalUtil

No comments:

Post a Comment


Related Posts Plugin for WordPress, Blogger...