What's new in OmniFaces?

What's new in OmniFaces 4.0?

Release date: 2 October, 2022

Major in OmniFaces 4.0

  • Minimum dependencies are changed from Java 1.8, JSF 2.3, EL 3.0, Servlet 3.1, CDI 2.0, WS 1.1 and BV 2.0 to Java 11, Faces 3.0, EL 4.0, Servlet 5.0, CDI 3.0, WS 2.0 and BV 3.0; as of now, OmniFaces 4.0 is NOT backwards compatible with previous versions of these dependencies because of the compiler-incompatible rename of the javax.* package to jakarta.* package.
  • All things which were during 3.x @Deprecated have been physically removed, such as <o:form includeViewParams="true"> (has become the default behavior), WebXml.INSTANCE and FacesConfigXML.INSTANCE (replaced by WebXml.instance() and FacesConfigXml.instance()) and omnifaces:fixviewstate.js (replaced by JSF 2.2 native fix)
  • #{now} and #{startup} will now return an instance of java.time.temporal.Temporal instead of java.util.Date; it still supports the time property as in #{now.time} and #{startup.time}; additionally, it's got two new convenience properties: instant and zonedDateTime as in #{now.instant}, #{now.zonedDateTime}, #{startup.instant} and #{startup.zonedDateTime}
  • Callback interfaces which dated from Java 1.7 and have replacements available in Java 1.8 are now @Deprecated. Callback.Void is replaced by Runnable, Callback.Returning is replaced by Supplier, Callback.WithArgument is replaced by Consumer and Callback.ReturningWithArgument is replaced by Function. Utility methods in Components and Events are have been adjusted.

OmniFaces 4.0 is basically the Jakartified version of OmniFaces 3.14 with the following changes:

Added in OmniFaces 4.0

  • #648 - Components#addFacesScriptResource() which allows the component developer to automatically include either the Faces 4.0-specific faces.js or the JSF 2.3-specific jsf.js depending on whether the former is available as a resource in the current deployment
  • #655 - Faces#addResponseCookie() got a new overload which allows adding custom attributes to the cookie such as SameSite:None (NOTE: works currently only when using minimally Mojarra 4.0.0-M2 on top of minimally Servlet 6.0.0-M1)

Changed in OmniFaces 4.0

  • #675 - All <h:outputScript library="omnifaces"> resources such as omnifaces.js were migrated from JavaScript to TypeScript