Search code examples
jsfjakarta-eejsf-2java-ee-6faces-config

Tell that webapp uses JSF without the need for an empty faces-config.xml


Is there any other way to tell Java EE 6 app server that project is going to use JSF than having an empty faces-config.xml?

I'd love to do this somehow using annotations or maybe initialization code on appcontext. Having an empty faces-config.xml looks namely really ugly to me. I'm pretty okay with default configuration, just wondering if it's possible to drop the physical faces-config.xml file somehow.

Currently I already don't have any web.xml and I'm quite ok with that, so registering the FacesServlet manually is not what I'm looking for.


Solution

  • This is only supported in JSF 2.1 and above, not in JSF 2.0. So you have to upgrade your JSF 2.0 libraries to JSF 2.1 or to target an apsperver which bundles JSF 2.1.