Hi all,
As part of the CDI alignment effort for JSF 2.3, I'd like to propose
another enhancement.
Currently, there are a lot of artifacts that can be wrapped (decorated) by
extending a FacesWrapper implementation and registering them at
faces-config.xml [1].
I'd like to be able to just use CDI decorators for this, like:
@Priority(1000)
@Decorator
public abstract MyCustomResourceHandler extends ResourceHandler {
@Inject
@Delegate
private ResourceHandler rh;
@Override
public Resource createResource(String resource) {
// ..
}
}
The only problem is that CDI requires the decorated artifact to be an
interface instead of a class. So to achieve this. So methods would need to
be extracted to new interfaces.
The end user benefits would be a simplified and more standard way to
decorate artifacts and less need for the faces-config.xml.
What do you think?
Regards,
Guillermo González de Agüero.
[1]
https://javaserverfaces.java.net/docs/2.2/javadocs/javax/faces/FacesWrapper.html