Hi,

On 17 February 2011 08:36, Captain Cid <captain_...@indiatimes.com> wrote:
>
> I wish to keep configuration property file outside my war. Suppose i keep it
> tomcathome/conf/myfile.properties
> How can I read it using classloader from my webapp application code. I am
> not able to access it.
>
> I tried using this.getClass().getClassLoader() or even
> this.getClass().getClassLoader().getParent() but coudnt !

Rather than trying to look up the config file path on the classpath
you could simply
ask the administrator to supply it in a context parameter override.

That way the administrator decides where it should go, not you and you
can supply
an internal default if you wish.

If you're using Spring this is very easily accomplished with their
ServletContextPropertyPlaceholderConfigurer
class

hope this helps

-- 
Best Regards,

Brett Delle Grazie

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to