You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by cowwoc <co...@bbs.darktech.org> on 2008/06/16 18:04:38 UTC

Using Guice with IInitializer?

Hi,

Can anyone think of a way to inject members into an IInitializer or at least
gain access to an Injector instance inside it? As far as I can tell I can't
even get access to the Servlet Context or Application from inside the
IInitializer. I'm open to suggestions.

Thanks,
Gili
-- 
View this message in context: http://www.nabble.com/Using-Guice-with-IInitializer--tp17867744p17867744.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Using Guice with IInitializer?

Posted by cowwoc <co...@bbs.darktech.org>.

Sorry, the reason I initially missed this option is that
GuiceWebApplicationFactory was not saving the Injector into the servlet
context. I've since fixed this and this now works.

Thanks,
Gili


igor.vaynberg wrote:
> 
> IInitializer.onInitializer(Application app) {
>   ServletContext sc=((WebApplication)app).getServletContext();
> 
> }
> 
> -igor
> 
> On Mon, Jun 16, 2008 at 9:04 AM, cowwoc <co...@bbs.darktech.org> wrote:
>>
>> Hi,
>>
>> Can anyone think of a way to inject members into an IInitializer or at
>> least
>> gain access to an Injector instance inside it? As far as I can tell I
>> can't
>> even get access to the Servlet Context or Application from inside the
>> IInitializer. I'm open to suggestions.
>>
>> Thanks,
>> Gili
>> --
>> View this message in context:
>> http://www.nabble.com/Using-Guice-with-IInitializer--tp17867744p17867744.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-Guice-with-IInitializer--tp17867744p17869212.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Using Guice with IInitializer?

Posted by Igor Vaynberg <ig...@gmail.com>.
IInitializer.onInitializer(Application app) {
  ServletContext sc=((WebApplication)app).getServletContext();

}

-igor

On Mon, Jun 16, 2008 at 9:04 AM, cowwoc <co...@bbs.darktech.org> wrote:
>
> Hi,
>
> Can anyone think of a way to inject members into an IInitializer or at least
> gain access to an Injector instance inside it? As far as I can tell I can't
> even get access to the Servlet Context or Application from inside the
> IInitializer. I'm open to suggestions.
>
> Thanks,
> Gili
> --
> View this message in context: http://www.nabble.com/Using-Guice-with-IInitializer--tp17867744p17867744.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org