Upgrading to JSF 2.4 - jsf

I'm trying to upgrade from JSF 2.2 to 2.4 in Netbeans 11.0.
I downloaded the binaries and added it as a new library:
But when I look into the properties of my project, I still see the old JSF versions 1.2 and 2.2:
Is adding it as a Maven dependency the only way to upgrade? I wanted to upgrade it globally, for all (future) projects.
I'm using Java EE 8 with Payara Server 5.192.

JSF 2.4 does not exist as an official API at all. Do not use it. Currently latest official version is 2.3 and the next one will be 3.0 which will be released as part of Jakarta EE 9 (which is essentially exactly the same as 2.3, but then with the package renamed from javax.faces to jakarta.faces).
See also the blog article Do not use org.glassfish Mojarra 2.4.0! written by yours truly.
No, JSF 2.4 is not there yet. Technically speaking, Mojarra 2.4.0 represents the latest state of the master branch as it was during the transfer from Oracle to Eclipse. That transfer took place when JSF 2.3 specification was already released and JSF 2.4 specification has still to be started yet. JSF 2.4 is far from being a beta, let alone a reasonable snapshot. And yet there is a Mojarra 2.4.0 in Maven instead of e.g. a Mojarra 2.4.0-M1. As per the agreement between Oracle and Eclipse, it was necessary to release the latest work on Mojarra under Oracle's umbrella into Maven Central before the transfer to Eclipse was completed. And later Eclipse will do the same after the transfer is completed so that the integrity can be validated by the public. Using version "2.4.0" is indeed way too confusing for the public, because does actually not at all represent a real "2.4.0" version, but it is what it is.
As to your specific problem with Netbeans, you need to upgrade it to see "JSF 2.3" as an option in its built-in dropdown. Alternatively you can also just ignore it and write JSF 2.3 targeted code yourself instead of letting the IDE autogenerate it. That's basically what that "JSF 2.3" option is doing. Autogenerating the suitable JSF 2.3 faces-config.xml file and such. But you as a programmer of course can easily write code yourself based on official documentation.

Related

java.lang.ClassNotFoundException: javax.servlet.ServletRegistration when using OmniFaces library on Glassfish v2.1

I'm trying to use the excellent OmniFaces library on a Glassfish v2.1 server.
It works well until I try to use the org.omnifaces.util.Faces class. In this case, I encounter a
java.lang.ClassNotFoundException: javax.servlet.ServletRegistration
From what I've gathered, it seems this class appeared with the Servlet 3.0 specification.
Glassfish v2.1 is only Servlet 2.5 compatible but OmniFaces documentation indicates that it only requires Servlet 2.5.
Is there something I'm missing ? Is this a dependency that was accidentally added ?
Full configuration is :
Myfaces 2.1.12
Glassfish v2.1.1 (9.1_02 Patch12)
OmniFaces 1.6
Thank you for your answers.
I've come across this article that explains things a bit more but I'm still confused as to whether or not it should work on Glassfish 2.1.
OmniFaces is indeed supposed to be Servlet 2.5 compatible, but that's not thoroughly tested as the development and showcase environments are Servlet 3.0 based. See also https://github.com/omnifaces/omnifaces/wiki/Java-EE-5-and-6-compatibility, so it may happen that something accidently slipped through. This is one of those things.
As per issue 298, this has been fixed for the current 1.8 snapshot.

jsf 2.2 not supported on glassfish 3.1.2?

Is jsf 2.2 not supported on glassfish 3.1.2?
My viewActions are not being invoked and some simple things do not behave same way as supposed with 2.1.23. So i am not sure about filing issues for 2.2
You can manually update the .jar file located at the Glassfish's /modules directory.
More information: How do I upgrade the JSF API in GlassFish?
By updating jar file some feature is supported. But, some of the feature. e.g. JSON processing is not supported. Use Glassfish 4.0 for best support.

Migration options for old java studio creator project to Icefaces

Our project currently uses the very old Java Studio Creator framework and now has new requirements and plans for future deployments which require the application to finally remove JSC and migrate to either 1.8.x or 2.0 of IceFaces.
A migration to 1.8.x seems to be the safest and most reliable option to take to me. Would delaying and not taking on the challenge of a migration JSF 2.0 make sense or should a migration directly to IceFaces 2.0 be used instead?
That <webuijsf:xxx> component library is called "Woodstock". Now you have new and solid keyword. ICEFaces was officially been pointed as recommended replacement of Woodstock projects when Woodstock was officially been abandoned and discontinued.
Woodstock to ICEFaces migration
Woodstock to ICEFaces porting guide
Woodstock to ICEFaces component migration matrix
ICEFaces 2 tutorials and examples
I personally recommend you to just take the ICEFaces migration path. It's well documented. Also, when you migrate to "plain" JSF 2.0, you'll have to redo the entire look'n'feel as "plain" JSF components does not ship with any bundled CSS. Going to ICEFaces 1.8 or 2.0 doesn't really matter that much. To take advantage of new JSF 2.0 features behind ICEFaces 2.0 you'll only have to change a lot of other things afterwards, but even without that, you should already have a working project.

JSF Richfaces upgrade

I'm fairly new to JSF and Richfaces.
I'm looking to upgrade our system from JSF 1.1.2 to the latest 2.0. Also looking at upgrading our Richfaces 3.0 to 3.3
Under the lib folder for old projects we currently have the following:
ajax4jsf-1.1.1.1.jar
commons-beanutils-1.7.0.0.jar
commons-collections-3.3.1.0.jar
commons-digester-1.6.0.0.jar
commons-logging-1.1.1.0.jar
jsf-api-1.1.2.0.jar
jsf-facelets-1.1.12.0.jar
jsf-impl-1.1.2.0.jar
jstl-1.1.2.0.jar
richfaces-3.0.1.1.jar
This is what I have added:
richfaces-api-3.3.3.Final (Added)
richfaces-impl-3.3.3.Final (Added)
richfaces-ui-3.3.3.Final (Added)
So what I'm looking for is info on what Jars I can remove and what Jars I'm missing that need to be added.
Thanks
Hmm, before talking about the libs... What's your goal using jsf 2.0 and rf 3.3? I am asking because rf 3.3 does not really make use of jsf 2.0. As the jsf 2.0 roadmap for richfaces says
The goal of JSF 2.0 support in the 3.3.3 release is to run your existing RichFaces 3.3.X applications in a JSF 2.0/EE6 environment with little or no changes.
See this link: jsf 2.0 roadmap for richfaces
OK, back to your libs... I don't remember them by heart, but at least you should change jsf-api and jsf-impl to 2.x versions and drop the old stuff. I would have a look at a rf 3.3 demo project, what is contained there.
You can also just use RichFaces Maven archetype and create a project with everything you need.

What implementation version of JSF that bundle with Glassfish 3.0.1

I am trying to find out what implementation version of JSF that bundle with Glassfish 3.0.1. Is it Mojarra 2.0.2 or 2.0.3
Here http://glassfish.java.net/downloads/3.0.1-final.html, it only tell me that it is JSF 2.0 but not sure what implementation is it.
I remember you can find out about that information by writing 1-2 simple line of codes, but I forgot. I am using Java-EE 6 BTW
It is 2.0.2. You can replace it with a download of 2.0.3 or even 2.1.0-RC (don't forget to clean the cache).
FacesContext.class.getPackage().getImplementationVersion();

Resources