This content has been marked as final.
Show 3 replies
-
1. Re: Can't cast RenderRequest to HttpServletRequest
mposolda Oct 16, 2010 12:52 PM (in response to ceik)Hi,
You can't cast RenderRequest to HttpServletRequest. RenderRequest is not instance of HttpServletRequest. RenderRequest has method getPortletSession, which you can use to save attributes to portlet session. More info is in javadoc for portlet 2.0 api or in JSR-286 specification.
Hope this helps,
Marek
-
2. Re: Can't cast RenderRequest to HttpServletRequest
jferreyram Oct 28, 2010 11:51 AM (in response to ceik)Hi
You can try this:
import org.gatein.pc.portlet.impl.jsr168.api.RenderRequestImpl;
........
Object request = //get the request
if (request instanceof RenderRequestImpl) {
RenderRequestImpl renderRequest = (RenderRequestImpl) reqObj;
HttpServletRequestWrapper hsrw = renderRequest.getRealRequest();//use the hsrw object
}
I hope this helps you.
Jorge
-
3. Re: Can't cast RenderRequest to HttpServletRequest
ceik Nov 3, 2010 9:03 AM (in response to jferreyram)Thanks Jorge, that helped!!