HttpServletRequest req = (HttpServletRequest)request.getAttribute("javax.portlet.request");
HttpServletResponse res = (HttpServletResponse)request.getAttribute("javax.portlet.response");
The request object can be a PortletRequest Object or a ActionRequest object.