public ELResolver getElResolver(AbstractProcessApplication processApplication) {
if (processApplication instanceof SpringProcessApplication) {
SpringProcessApplication springProcessApplication = (SpringProcessApplication) processApplication;
return new ApplicationContextElResolver(springProcessApplication.getApplicationContext());
} else if (processApplication instanceof ServletProcessApplication) {
ServletProcessApplication servletProcessApplication = (ServletProcessApplication) processApplication;
if(!ClassUtils.isPresent("org.springframework.web.context.support.WebApplicationContextUtils", processApplication.getProcessApplicationClassloader())) {
LOGGER.log(Level.FINE, "WebApplicationContextUtils must be present for SpringProcessApplicationElResolver to work");
return null;
}
ServletContext servletContext = servletProcessApplication.getServletContext();
WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
if(applicationContext != null) {
return new ApplicationContextElResolver(applicationContext);
}
}
LOGGER.log(Level.FINE, "Process application class {0} unsupported by SpringProcessApplicationElResolver", processApplication);