Untitled
By: a guest | Mar 18th, 2010 | Syntax:
Java | Size: 1.29 KB | Hits: 58 | Expires: Never
private void loadAdditionalConfig(ApplicationContext ctx,
ServletConfig servletConfig) {
String location = servletConfig.getInitParameter("config-location");
if (location == null) {
location = "/WEB-INF/cxf-servlet.xml";
}
InputStream is = null;
try {
is = servletConfig.getServletContext().getResourceAsStream(location);
if (is == null || is.available() == -1) {
URIResolver resolver = new URIResolver(location);
if (resolver.isResolved()) {
is = resolver.getInputStream();
}
}
} catch (IOException e) {
//throw new ServletException(e);
}
if (is != null) {
LOG.log(Level.INFO, "BUILD_ENDPOINTS_FROM_CONFIG_LOCATION", new Object[]{location});
childCtx = new GenericApplicationContext(ctx);
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(childCtx);
reader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
reader.loadBeanDefinitions(new InputStreamResource(is, location));
childCtx.refresh();
}
}