Using Multiple ELResolvers with CompositeELResolver in JSF

Imagine the case where you have a JSF application that’s already using some custom ELResolver, but you want to get all the benefits of spring and want to have the SpringBeanFacesELResolver. Well, it’s rather simple:

public class MyCompositeELResolver extends javax.el.CompositeELResolver {

	public class MyCompositeELREsolver() {
		add(new YourCustomELResolver());
		add(new SpringBeanFacesELResolver());
	}
}

Note that the resolvers are ‘consulted’ in the order they are added.

Now just define your newly created composite resolver as in faces-config.xml.

It also appears possible to define two (or more) <el-resolver> tags in faces-config.xml to achieve the same thing.

1 thought on “Using Multiple ELResolvers with CompositeELResolver in JSF”

Leave a Reply

Your email address will not be published.