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
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
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
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
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
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");
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
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