Hi,
I have a class which has to be initialised with 2 properties which are
stored as http session attributes. These initialisation properties
will be passed to the constructor of the class so, for binding it's
interface to this class I am thinking of writing a provider. Code is
something like this:
interface A {
}
class DefaultA implements A {
public DefaultA(String x, String y) {
// x and y are values stored in users HTTP session...
}
}
class AProvider implements Provider<A> {
public A get() {
return new DefaultA(x, y); /// !!!! Here is the problem.. How
can I access x and y from the HTTP session here?
}
}
Binding is as follows..
bind(A.class).toProvider(AProvider.class).in(ServletScopes.SESSION);
Is there a way to inject HTTP Session values in the Provider class
above? Is there something wrong in my design?
Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---