I provide HttpServletRequest injection throughout JCatapult because it  
is pretty much needed everywhere unless you use an adapter or just  
copy everything into another object. I also use the request pretty  
often in my action classes for retrieving additional bits of  
information on the request or just reading the input stream. In the  
end, any solution turns out to be almost identical to using the  
request itself. This is because the request or any type of wrapper/ 
adapter/copy is scoped and should not be passed to singletons or  
objects whose life is longer than the requests life. I think you just  
need to be careful, but not injecting it at all seems too strict to me.

-bp


On Aug 3, 2009, at 8:31 PM, Bob Lee wrote:

> I personally wouldn't inject HttpServletRequest anywhere deeper in  
> the object graph than the servlet.
>
> Bob
>
> On Mon, Aug 3, 2009 at 6:16 PM, Paul Lindner <[email protected]>  
> wrote:
>
> I've been looking into Reqest Scopes and GuiceFilter and noticed that
> it uses a ThreadLocal to store the request state.  This works fine for
> single threaded request/response model.  However if an application
> uses a cached thread pool or child threads then injection is not
> possible.
>
> Is there a solution in the works for this situation?  An
> InheritableThreadLocal would suffice for threads created by the
> request thread -- however using something like
> Executors.newCachedThreadPool(); would not.
>
> Thanks.
> paul
>
>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to