public DefaultSettings() {
ArrayList< Settings > list = new ArrayList< Settings >();
// stuts.properties, default.properties
try {
list.add(new PropertiesSettings("struts"));
} catch (Exception e) {
log.warn("DefaultSettings: Could not find or error in struts.properties", e);
}
Settings[] settings = new Settings[list.size()];
delegate = new DelegatingSettings(list.toArray(settings));
// struts.custom.properties
try {
StringTokenizer customProperties = new StringTokenizer(delegate.getImpl(StrutsConstants.STRUTS_CUSTOM_PROPERTIES), ",");
while (customProperties.hasMoreTokens()) {
String name = customProperties.nextToken();
try {
list.add(new PropertiesSettings(name));
} catch (Exception e) {
log.error("DefaultSettings: Could not find " + name + ".properties. Skipping.");
}
}
settings = new Settings[list.size()];
delegate = new DelegatingSettings(list.toArray(settings));
} catch (IllegalArgumentException e) {
// Assume it's OK, since IllegalArgumentException is thrown
// when Settings is unable to find a certain setting,
// like the struts.custom.properties, which is commented out
}
}