Sunday, April 12, 2020

OmniFaces 3.5 has been released!

OmniFaces 3.5 has been released!

A handful utility functions/methods have been added:

  • #{of:encodeURI()} EL function so that you can URI-encode parts of URLs outside the query string. There was indeed already an #{of:encodeURL()}, but this is only useful to encode query string parameter names and values. This was not useful to encode the domain or path.
    Usage example:
    <a href="//example.com/#{of:encodeURI(bean.path)}/foo.xhtml?bar=#{of.encodeURL(bean.param)}">link</a>
  • Messages#clearXxx() utility methods so that you can programmatically clear out specific messages.
    Some examples:
    Messages.clear(); // Clears ALL messages
    Messages.clearGlobal(); // Clears all GLOBAL messages
    Messages.clearInfo(); // Clears all INFO messages
    Messages.clearWarn("form:input1", "form:input2"); // Clears all WARN messages on specified components
  • Messages#throwXxx() utility methods so that you can now write less code to throw a converter or validator exception.
    Previous:
    throw new ValidatorException(Messages.createError("Your fault!"));
    Now:
    Messages.throwValidatorException("Your fault!");

You can find the complete list at What's new in OmniFaces 3.5? list in showcase.

Installation

Non-Maven users: download OmniFaces 3.5 JAR and drop it in /WEB-INF/lib the usual way, replacing the older version if any.

Maven users: use <version>3.5</version>.

<dependency>
    <groupId>org.omnifaces</groupId>
    <artifactId>omnifaces</artifactId>
    <version>3.5</version>
</dependency>

How about OmniFaces 2.x and 1.1x?

The 2.x got the same bugfixes as 3.5 and has been released as 2.7.4. This version is for JSF 2.2 users with CDI. In case you've already migrated to JSF 2.3, use 3.x instead.

The 1.1x is basically since 2.5 in maintenance mode. I.e. only critical bugfix versions will be released. It's currently still at 1.14.1 (May 2017), featuring the same features as OmniFaces 2.4, but without any JSF 2.2 and CDI things and therefore compatible with CDI-less JSF 2.0/2.1.

Hey, I'm seeing a OmniFaces 4.x?

Indeed, yesterday the OmniFaces 4.x branch was created. It's fully Java 11 and Jakarta EE 9 targeted. All javax.* packages in OmniFaces 4.0-SNAPSHOT have already been migrated to jakarta.*. Yay!

No comments: