Run applications in JSF 2.2 compatible mode
For those not ready for new CDI activation, JSF 2.3 provides a compatible mode to make your codes working seamlessly with a JSF 2.2 faces-config.xml.
In contrast with the former JSF 2.3 configuration, we should perform some modification here.
Use a 2.2 versioned faces-config.xml instead.
Declare a beans.xml, CDI is enabled by default in Java EE 7, so it is optional.
Add 3.1 versioned web.xml. It is optional, but the compatible mode only works with 3.1, does not work with a 4.0 versioned web.xml.
Remove the
@FacesConfig
annotated class, it is only for JSF 2.3.
Done.
Now create a simple sample to try it.
Firstly create a simple backing bean.
And a simple Facelets template.
In NetBeans IDE, run it on Glassfish directly, finally it will open the home page.
Get the source codes from my GitHub account.
Last updated