Last year, I have implemented my own scope for Adobe/Day CQ based application framework which introduces dependency injection everywhere plus one JSP TAG which lookups objects in injector. What I was is almost identical to RequestScope of the aforementioned Guice Servlet extension with slightly different integration. In main module I bind that scope implementation with my own @RequestScoped annotation. In your case - I suggest you to do the same. Read the Guice Servlet source code, especially the scope implementations and create your own based on that - it will help you understand how does scope work behind the scenes.
Regards, Witold Szczerba On 7 August 2011 11:38, rod <[email protected]> wrote: > Hi. Yes I did read these docs, but my app implements it's own simple web > server and does not use servlets or a servlet container, which is why I was > confused about if I'd be able to use this. Re reading the docs it still > doesn't seem possible to use the servlet request scope in my application, > and it looks like I will need to write a custom scope. Can anyone confirm > this please? > > Thanks a lot, > Rod. > > On Sunday, 7 August 2011, Christopher Currie <[email protected]> wrote: >> Have you looked at the Guice Servlet [1] extension? Among other >> features, it defines a @Request scope that is designed for exactly >> what you describe. >> >> [1] http://code.google.com/p/google-guice/wiki/Servlets >> >> >> On 8/6/11, rod <[email protected]> wrote: >>> My application implements its own web server and I'd like to have a >>> scope for the request/response/etc... objects that get created on each >>> request and injected into all the individual request handling classes. >>> at the moment these are being manually created and injected, but i'd >>> like to be able to do this with guice. i've been reading the docs but >>> need a little advice - can i accomplish this with any of the built in >>> guice scopes, or will i need to create a custom scope (docs say this >>> is not reccomended!). >>> >>> thanks, >>> rod. >>> >>> -- >>> 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. >>> >>> >> >> -- >> 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. >> >> > > -- > 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. > -- 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.
