I actually don't see any need for Injector to be an instance field of InjectedServlet: I think it would be sufficient for it to be a local variable scoped to InjectedServlet#init, because subclasses of InjectedServlet should have all their injections performed no later than at init time.
Note that Injector is already stored in ServletContext. On 2010/06/26 01:29:51, Paul Lindner wrote:
Hrm, that's true... Also note that the injector itself is stored in InjectedServlet, that would also need to move to the ServletContext
too..
tricky...
On 2010/06/26 00:56:07, janluehe wrote: > Thanks, Paul. How would this work during deserialization, though? > > On 2010/06/26 00:44:29, http://plindner_linkedin.com wrote: > > hmm. I'm not a big fan of how this is implemented. > > > > I think it might be better to inject a Provider<foo> and then just
call
> > get() on that. That would allow us to make those fields final
variables.
> > > > On Thu, Jun 24, 2010 at 9:37 PM, <mailto:[email protected]>
wrote:
> > > > > Patch which address non-transient non-serializable Servlet
instance
> > > fields > > > > > > > > > http://codereview.appspot.com/1712045/show > > > > >
http://codereview.appspot.com/1712045/show
