Difference / Equality com.sun.faces> jsf-impl and org.glassfish> javax.faces (2.2.4)

In my JSF2 application, I came across NPE in Primefaces (5.1) autocomplete in

org.primefaces.component.autocomplete.AutoCompleteRenderer .encodeSuggestionsAsList(AutoCompleteRenderer.java:492)

I solved my problem by replacing the maven dependency

 <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-impl</artifactId> <version>2.2.4</version> </dependency> 

by

 <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.faces</artifactId> <version>2.2.4</version> </dependency> 

That scares me.

Searching pages by project pages I found these maven repositories:

http://mvnrepository.com/artifact/com.sun.faces/jsf-impl/2.2.4
http://mvnrepository.com/artifact/org.glassfish/javax.faces/2.2.4

They both claim the same description and link to the same URL as the Homepage:

Description: Implementation of Oracle JSF 2.2 Specification (2.2.4)
Homepage: http://java.sun.com/javaee/javaserverfaces/

Can someone explain the difference? Shouldn't it be exactly the same?

Hint: I know about the history of the sun and Oracle .;)

+5
source share
1 answer

com.sun.faces:jsf-impl contains only the implementation (Mojarra). It lacks an API. You will need com.sun.faces:jsf-api .

org.glassfish:javax.faces is a single JAR package containing both the API and the impl (you can also see it in the file size).

As for your specific problem when using only jsf-impl , you apparently forgot jsf-api , or you relied on javax:javaee-web-api , actually using non-Java EE like Tomcat.

+6
source

Source: https://habr.com/ru/post/1211073/


All Articles