if (associate != null) {
associate.setFacesELResolverForJsp(compositeELResolverForJsp);
}
// get JspApplicationContext.
JspApplicationContext jspAppContext = JspFactory.getDefaultFactory()
.getJspApplicationContext(context);
// cache the ExpressionFactory instance in ApplicationAssociate
if (associate != null) {
associate.setExpressionFactory(jspAppContext.getExpressionFactory());
}
// register compositeELResolver with JSP
try {
jspAppContext.addELResolver(compositeELResolverForJsp);
}
catch (IllegalStateException e) {
ApplicationFactory factory = (ApplicationFactory)
FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
Application app = factory.getApplication();
if (app.getProjectStage() != ProjectStage.UnitTest && !reloaded) {
throw e;
}
}
// register JSF ELContextListenerImpl with Jsp
ELContextListenerImpl elContextListener = new ELContextListenerImpl();
jspAppContext.addELContextListener(elContextListener);
}
}