use of com.haulmont.cuba.core.sys.SingleAppResourcePatternResolver in project cuba by cuba-platform.
the class SingleAppRestApiServlet method createWebApplicationContext.
@Override
protected WebApplicationContext createWebApplicationContext(ApplicationContext parent) {
if (this.logger.isDebugEnabled()) {
this.logger.debug("Servlet with name '" + getServletName() + "' will try to create custom WebApplicationContext context of class '" + CubaXmlWebApplicationContext.class.getName() + "'" + ", using parent context [" + parent + "]");
}
ConfigurableWebApplicationContext wac = new CubaXmlWebApplicationContext() {
@Override
protected ResourcePatternResolver getResourcePatternResolver() {
if (dependencyJars == null || dependencyJars.isEmpty()) {
throw new RuntimeException("No JARs defined for the 'web' block. " + "Please check that web.dependencies file exists in WEB-INF directory.");
}
return new SingleAppResourcePatternResolver(this, dependencyJars);
}
};
wac.setEnvironment(getEnvironment());
wac.setParent(parent);
wac.setConfigLocation(getContextConfigLocation());
configureAndRefreshWebApplicationContext(wac);
return wac;
}
use of com.haulmont.cuba.core.sys.SingleAppResourcePatternResolver in project cuba by cuba-platform.
the class SingleAppIdpServlet method createWebApplicationContext.
@Override
protected WebApplicationContext createWebApplicationContext(ApplicationContext parent) {
if (this.logger.isDebugEnabled()) {
this.logger.debug("Servlet with name '" + getServletName() + "' will try to create custom WebApplicationContext context of class '" + CubaXmlWebApplicationContext.class.getName() + "'" + ", using parent context [" + parent + "]");
}
ConfigurableWebApplicationContext wac = new CubaXmlWebApplicationContext() {
@Override
protected ResourcePatternResolver getResourcePatternResolver() {
if (dependencyJars == null || dependencyJars.isEmpty()) {
throw new RuntimeException("No JARs defined for the 'web' block. " + "Please check that web.dependencies file exists in WEB-INF directory.");
}
return new SingleAppResourcePatternResolver(this, dependencyJars);
}
};
wac.setEnvironment(getEnvironment());
wac.setParent(parent);
wac.setConfigLocation(getContextConfigLocation());
configureAndRefreshWebApplicationContext(wac);
return wac;
}
Aggregations