Yes ..got your point...using spring its easy though My only question is ,
can it be accessed using classloader and getResource() Brett Delle Grazie-3 wrote: > > 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 > > > -- View this message in context: http://old.nabble.com/Reading-a-file-in-tomcathome-conf-folder-tp30947709p30948198.html Sent from the Tomcat - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org