Here it is an example of using referencing a producer method via an EL name. The EL expressions used in the JSF page:
#{someFoo}
#{moreFoo}
#{moreFoo}
The Fooqualifier:
@Qualifier
@Retention(RUNTIME)
@Target({METHOD, FIELD, PARAMETER, TYPE})
public @interface Foo {
}
And the bean containing the producer method:
@Named
@ApplicationScoped
public class TheBean {
@Produces
@Named
@Foo
String getSomeFoo() {
return "foo";
}
@Produces
@Named("moreFoo")
@Foo
String getExtraFoo() {
return "extra-foo";
}
}
The complete example is available here.