Some of us (including me) tried to do the same thing but failed. See here
http://markmail.org/message/hdcboxjrxkrgruyy for the discussion. It seems
to come down to the order in which services are instantiated. By the time
your service is being instantiated, the ServletContext has not yet been
set in the ApplicationGlobals service and thus is null. At the moment,
there doesn't seem to be a workaround if you want to configure your
services whith init-params. You could, however, use a properties file. How
to do that is explained here:
http://wiki.apache.org/tapestry/Tapestry5HowToReadSymbolsFromPropertiesFile

HTH,

Uli

Am Di, 7.10.2008, 10:42, schrieb Edouard sur edouardmercier.fr:
> Hello again.
>
> I would like the service implementation binding (inside the
> "AppModule::bind(ServiceBinder binder)") to depend on the web.xml
> configuration file. This is the reason why I would like to access the
> ApplicationGlobal instance inside the method (in order to call as
> "globals.getServletContext().getInitParameter("MyParam")"), so as to
> provide the right implementation depending on some "context-param"
> value.
>
> Is it feasible? Is there a work-around, or another way to achieve that,
> please?
>
> Thank you so much for your help.
> Édouard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to