On Feb 16, 3:42 pm, "Dhanji R. Prasanna" <[email protected]> wrote:
> However, it is possible that the binding is valid if it is a linked
> binding to a singleton...
You can follow the links by calling Injector.getBinding() and using
the BindingTargetVisitor. Alongside the explicit scoping, instance
bindings are natural singletons.
On Feb 16, 3:44 pm, Bob Lee <[email protected]> wrote:
> Why does Guice Servlet impose this restriction? Seem like your servlet
> should be allowed to have any scope.
If a user doesn't specify a scope explicitly, he'll probably expect
singleton scoping (which is consistent with other servlet containers).
If NO_SCOPE is our default, that could be quite surprising.
So mandating singleton scope prevents the user from being surprised.
It also means we're consistent with every other servlet container.
Probably a good thing.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice-dev" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---