Servlets.setBrowserIdentifier(new BrowserIdentifier());
//plugin device-dependent browser identifier
//load config as soon as possible since it might set some system props
final Configuration config = new Configuration();
final ConfigParser parser = new ConfigParser();
//load metainfo/zk/config.xml
try {
parser.parseConfigXml(config);
} catch (Throwable ex) {
log.error("Unable to load metainfo/zk/config.xml", ex);
}
//load metainfo/zk/zk.xml
try {
final ClassLocator loc = new ClassLocator();
for (Enumeration en = loc.getResources("metainfo/zk/zk.xml");
en.hasMoreElements();) {
final URL cfgUrl = (URL)en.nextElement();
try {
parser.parse(cfgUrl, config, loc);
} catch (Throwable ex) {
log.error("Unable to load "+cfgUrl, ex);
}
}
} catch (Throwable ex) {
log.error("Unable to load metainfo/zk/zk.xml", ex);
}
//load /WEB-INF/zk.xml
try {
final URL cfgUrl = _ctx.getResource("/WEB-INF/zk.xml");
if (cfgUrl != null)
parser.parse(cfgUrl, config, new ServletContextLocator(_ctx));
} catch (Throwable ex) {
log.error("Unable to load /WEB-INF/zk.xml", ex);
}
//after zk.xml is loaded since it depends on the configuration