Open GoogleCodeExporter opened 9 years ago
Just a quick note: This is not a defect -- it's a trivial feature.
Original comment by arn...@gmail.com
on 22 Aug 2008 at 12:10
Ooops. Forgot to add the ServletContextScoped @interface to subversion before
running
diff. Fixed in the new attachment.
Original comment by arn...@gmail.com
on 1 Sep 2008 at 12:55
Attachments:
Original comment by limpbizkit
on 2 Nov 2008 at 9:15
I'm not sure I understand how this is different from singleton scope? In the
patch, the servletcontext is stored in
a static field anyway...
Original comment by dha...@gmail.com
on 28 Nov 2008 at 8:18
Well, you can't inject javax.servlet.ServletContext into a singleton (if I
remember
correctly). You'd have to use a Provider, which isn't bad, it just isn't
obvious for
the most basic users. Perhaps documenting the case, and letting users know that
they
mustn't attempt to access the ServletContext instance unless the code is
actually run
inside a request.
With my patch you could've accessed the ServletContext instance as soon as the
application was initialized, since the class it was injected to would've been
bound
to the scope of the web application.
Hope my intentions are clear.
Original comment by arn...@gmail.com
on 30 Dec 2008 at 3:28
OK I believe the Provider is an acceptable compromise in this case, since it
will throw an OutOfScopeException if
accessed outside a request anyway.
Closing this bug.
Original comment by dha...@gmail.com
on 31 Jan 2009 at 5:38
Original issue reported on code.google.com by
arn...@gmail.com
on 19 Aug 2008 at 11:43Attachments: