struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris <>
Subject Re: Struts How to read external properties files or conf files
Date Sun, 08 Sep 2013 08:58:00 GMT
Thanks Leonidas

Hi there,

webwork used to have a class that would easily read
external sources like xml files, but i do not recall the class name now. If you want to read
from simple property files you could use something 
like :

String path = ServletActionContext.getServletContext().getRealPath("");

Properties prop = new Properties();

try {
    // load properties from the class path
    prop.load(new FileInputStream(path
            + "//WEB-INF//classes//"));
} catch (IOException ex) {

//get parameter param1
String param1 = prop.getProperty("param1"); 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message