Re: Read and write inside WEB-INF

2007-07-15 Thread Manivannan Palanichamy
I too do the same thing; I am reading properties from a property file, thats under WEB-INF/classes directory. code is: InputStream in = getClass().getClassLoader().getResourceAsStream(" sample.properties"); Code is working fine. -- Manivannan.Palanichamy (@) Oracle.com http://mani.gw.googlepa

Re: Read and write inside WEB-INF

2007-07-14 Thread hanasaki
Confirmed. A real pain in the bum... I do not let my folks use unpacked WARs. There were once a bunch of guys that put custom log files in the unpacked WAR directory... shame shame. David Smith wrote: > Only works for unpacked web applications. If you attempt getRealPath > from inside a packed

Re: Read and write inside WEB-INF

2007-07-14 Thread David Smith
Only works for unpacked web applications. If you attempt getRealPath from inside a packed war file it will return null. --David hanasaki wrote: Hmmm does this work for packed WAR's or only Unpacked... ? Jacob Rhoden wrote: Much Appreciated! Thanks. Edoardo Panfili wrote: Jacob Rh

Re: Read and write inside WEB-INF

2007-07-14 Thread Joe Nathan
ndexOf("/"); if (x>=0) st1 = st1.substring(0, x); } st1 = st1.replace("/", File.separator); // directory; base = st1+File.separator; System.out.println("Base: "+base); } catch (Throwable t1) { t1.printStackTrace(); } } -- View this mes

Re: Read and write inside WEB-INF

2007-07-14 Thread hanasaki
Hmmm does this work for packed WAR's or only Unpacked... ? Jacob Rhoden wrote: > Much Appreciated! Thanks. > > Edoardo Panfili wrote: >> Jacob Rhoden ha scritto: >>> what is the correct way to find the location of your WEB-INF >>> directory (or your apps directory for that matter). >>> >> try wi

Re: Read and write inside WEB-INF

2007-07-14 Thread Jacob Rhoden
Much Appreciated! Thanks. Edoardo Panfili wrote: Jacob Rhoden ha scritto: what is the correct way to find the location of your WEB-INF directory (or your apps directory for that matter). try with String x = this.getServletContext().getRealPath("WEB-INF");

Re: Read and write inside WEB-INF

2007-07-14 Thread Edoardo Panfili
Jacob Rhoden ha scritto: Hi, I have seen a few apps do this now and I would like to do it, to have a configure page that read and writes a properties file somewhere inside the WEB-INF directory. That said, I have been researching and cant find out where, what is the correct way to find the lo

Read and write inside WEB-INF

2007-07-14 Thread Jacob Rhoden
Hi, I have seen a few apps do this now and I would like to do it, to have a configure page that read and writes a properties file somewhere inside the WEB-INF directory. That said, I have been researching and cant find out where, what is the correct way to find the location of your WEB-INF di