CompositeELResolver compositeElResolver = new CompositeELResolver();
compositeElResolver.add(new VariableScopeElResolver());
if(beans != null) {
// Only expose limited set of beans in expressions
compositeElResolver.add(new ReadOnlyMapELResolver(beans));
} else {
// Expose full application-context in expressions
compositeElResolver.add(new ApplicationContextElResolver(applicationContext));
}