You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Ghosty <ti...@gmail.com> on 2010/02/26 19:13:09 UTC

Retrieving context from the HttpServletRequest request, is it possible?

I know you can get at the request from the context, but is it possible to do
it vice versa?

I've tried all sorts of request.getAttribute("context") in hopes it might
have been stuffed in there too.

Basically in my controller.xml I have a requestmap event type java
triggering a method which comes in as the HttpServletRequest request and I
want to get at the context to pass on to some other methods.

Thanks.
-- 
View this message in context: http://n4.nabble.com/Retrieving-context-from-the-HttpServletRequest-request-is-it-possible-tp1571081p1571081.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Retrieving context from the HttpServletRequest request, is it possible?

Posted by Scott Gray <sc...@hotwaxmedia.com>.
What are you trying to do with the context once you get it?

If you want to put a value in the context then all you can do at the event stage is to add it as a request attribute.
If you want to get a value from the "context" (it doesn't really exist yet at this stage) then your best bet is to use the UtilHttp.getCombinedMap(...) method.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 26/02/2010, at 11:13 AM, Ghosty wrote:

> 
> I know you can get at the request from the context, but is it possible to do
> it vice versa?
> 
> I've tried all sorts of request.getAttribute("context") in hopes it might
> have been stuffed in there too.
> 
> Basically in my controller.xml I have a requestmap event type java
> triggering a method which comes in as the HttpServletRequest request and I
> want to get at the context to pass on to some other methods.
> 
> Thanks.
> -- 
> View this message in context: http://n4.nabble.com/Retrieving-context-from-the-HttpServletRequest-request-is-it-possible-tp1571081p1571081.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.