Hi,
how about ServletContext.getResourceAsStream("/WEB-INF/props.properties")?
You can do it in a ServletContextListener.contextInitialized() method and
use this methods parameter to get hold of the ServletContext instance.
Jambalaya
On Fri, Jul 24, 2009 at 8:41 AM, Alberto <[email protected]> wrote:
>
> I have a properties file in WEB-INF, I want to load and bind this
> file from a Guice's module.
>
> I have no problems loading and binding if the Module is used in a
> standalone Java program
>
> ClassLoader loader = MyGuiceModule.class.getClassLoader();
>
> but I do not know how to do this when I try to bootstrap this for a
> web application.
>
> Does anyone know how to load and bind a properties file from a Guice
> Module when the module is being used in a Web application?
>
> 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
-~----------~----~----~----~------~----~------~--~---