@Produces
@Composite
public ELResolver getELResolver(@Resolver Instance<ELResolver> resolvers, BeanManager beanManager) {
// Create the default el resolvers
CompositeELResolver compositeResolver = new CompositeELResolver();
compositeResolver.add(beanManager.getELResolver());
compositeResolver.add(new MapELResolver());
compositeResolver.add(new ListELResolver());
compositeResolver.add(new ArrayELResolver());
compositeResolver.add(new ResourceBundleELResolver());
compositeResolver.add(new BeanELResolver());
boolean isGlassFish = System.getProperty("glassfish.version") != null;
if (isGlassFish) {
for (ELResolver resolver : getReferences(beanManager, ELResolver.class, new ResolverLiteral())) {
compositeResolver.add(resolver);
}
} else {
for (ELResolver resolver : resolvers) {
compositeResolver.add(resolver);
}
}
return compositeResolver;
}