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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: