-
1. Re: Accessing HttpServletRequest from RenderRequest
thanvi Nov 28, 2006 11:29 PM (in response to david.hoffman)Hi
Even i am trying to do the same, have you succeded.
Please let me know -
2. Re: Accessing HttpServletRequest from RenderRequest
david.hoffman Nov 29, 2006 9:10 AM (in response to david.hoffman)Sure, I thought I had posted this, but I guess I didn't.
the request object in the sample below is JBossRenderRequest.public String getCookieValue(String cookieName) { String value = ""; cookieName = "JSESSION"; try { HttpServletRequest req = (HttpServletRequest)request.getAttribute("javax.portlet.request"); Cookie[] cookies = req.getCookies(); for (int j=0; j<cookies.length; j++) { Cookie cookie = cookies[j]; if (cookie.getName().equalsIgnoreCase(cookieName)) { value = cookie.getValue(); } } } catch (Exception e) { log.error("Error in getCookieValue()", e); } return value; }
-
3. Re: Accessing HttpServletRequest from RenderRequest
thanvi Nov 30, 2006 6:59 AM (in response to david.hoffman)Hi
But my method takes RenderRequest not the JBossRenderREquest.
I try to convert the JBossActionRequest / RenderRequest to HttpServletREquest.
I am trying all combinations no luck.
How did u arrive at converting the JBossRenderRequest to HttpservletRequest.
Thanks -
4. Re: Accessing HttpServletRequest from RenderRequest
thanvi Nov 30, 2006 6:59 AM (in response to david.hoffman)Hi
But my method takes RenderRequest not the JBossRenderREquest.
I try to convert the JBossActionRequest / RenderRequest to HttpServletREquest.
I am trying all combinations no luck.
How did u arrive at converting the JBossRenderRequest to HttpservletRequest.
Thanks -
5. Re: Accessing HttpServletRequest from RenderRequest
antoine_h Mar 6, 2007 6:02 PM (in response to david.hoffman)hello,
I have the same problem with this way.
I did it this way :
http://jboss.org/index.html?module=bb&op=viewtopic&p=4025615#4025615
It is the same with RenderRequest and PortletRequest... -
6. Re: Accessing HttpServletRequest from RenderRequest
suganthivelayutham Dec 7, 2007 6:59 AM (in response to david.hoffman)Hi,
I tried the solution,
HttpServletRequest req = (HttpServletRequest)request.getAttribute("javax.portlet.request"); // request is JBossRenderRequest object
but it FAILED
Im getting java.lang.ClassCastException: org.jboss.portlet.JBossRenderRequest
Is any other things I have to do to get it casted? -
7. Re: Accessing HttpServletRequest from RenderRequest
bvogt Dec 7, 2007 7:17 AM (in response to david.hoffman)???
HttpServletRequest req = request.getServerInvocation().getServerContext().getClientRequest();
-
8. Re: Accessing HttpServletRequest from RenderRequest
bvogt Dec 7, 2007 7:20 AM (in response to david.hoffman)sorry, I copied the wrong line, I meant:
HttpServletRequest req = request.getControllerContext().getServerInvocation().getServerContext().getClientRequest();