public void init(ActionServlet servlet, ModuleConfig config)
throws ServletException {
// Parse the configuration file specified by path or resource
try {
ConfigParser parser = new ConfigParser();
URL configResource = null;
if (path != null) {
log.info("Loading context relative resources from '" +
path + "'");
configResource =
servlet.getServletContext().getResource(path);
} else if (resource != null) {
log.info("Loading classloader resources from '" +
resource + "'");
ClassLoader loader =
Thread.currentThread().getContextClassLoader();
if (loader == null) {
loader = this.getClass().getClassLoader();
}
configResource = loader.getResource(resource);
}
parser.parse(configResource);
} catch (Exception e) {
log.error("Exception loading resources", e);
throw new ServletException(e);
}