Thursday, December 14, 2017

This is the first second (27 december 2017) release candidate of OmniFaces 3.0, which is the first version developed specifically for JSF 2.3 and Java 1.8. As of now, it won't run when you still have JSF 2.2 or Java 1.7 installed, but it will run when you still have CDI 1.1 installed, in spite of a CDI 2.0 dependency marked provided. It may change later when CDI 1.2 or 2.0 specific features are utilized.

I will later go in more detail about the changes when 3.0 final is released, for now below is a quick overview of all changes so far as compared to 2.6.7:

Breaking changes:

<o:form useRequestURI="true"> is now the default behavior of <o:form> as it was basically the main reason to use <o:form>. I.e. it will always submit to exactly the same URL as in browser's address bar whereas the <h:form> only submits to the forwarded URL without query string, causing among others view parameters and path parameters to get lost every time. You can if necessary disable this by <o:form useRequestURI="false"> or switching back to <h:form>.

<o:form> will now by default perform a partial submit on any JSF ajax request. In other words, only the parameters actually covered by execute attribute of <f:ajax> will be sent, hereby reducing the request payload to not contain unnecessary parameters. This is similar to PrimeFaces partialSubmit feature. You can if necessary disable this by <o:form partialSubmit="false">.

ValidateMultipleFields (all multi-field validators basically) have previously skipped all disabled/readonly/nonrendered inputs. Now they won't anymore be skipped, and the values argument (3rd argument of validate method) will contain their current model value (and thus not the submitted value).

Package org.omnifaces.component.output.cache has been migrated to org.omnifaces.util.cache and several previously private/hidden artifacts have been made public, so that it's now more useful for non-component related caches.

All Faces/FacesLocal/Components/Servlets methods which previously threw IOException will now throw Java8's java.io.UncheckedIOException instead, hereby reducing down unnecessary throws IOException boilerplate in methods because those should always be bubbled up into the container.

org.omnifaces.facesviews.FacesServletDispatchMethod and ViewHandlerMode which was deprecated since 2.6 have now been removed without replacement (as they have become superfluous since Servlet 3.0).

org.omnifaces.renderkit.Html5RenderKit which was deprecated since 2.2 has now been removed without replacement (as this has become superfluous since JSF 2.2 with new passthrough attribtue feature).

org.omnifaces.config.BeanManager which was deprecated since 2.5 has now been removed with org.omnifaces.util.Beans as replacement.

RichFaces targeted hacks have been removed. OmniFaces 3.0 is therefore not anymore compatible with RichFaces. Note that RichFaces itself was declared "End of Life" June 2016 and is already not compatible with JSF 2.3.

New things:

<o:selectItemGroups> has been added which should remove the need to manually bake SelectItemGroup/SelectItem[] instances in beans as there's (still) no corresponding tag in standard JSF for this.

<o:url> has been extended with a value attribute which can take an arbitrary/external URL.

omnifaces.ImplicitNumberConverter which extends <f:convertNumber>, but doesn't annoyingly require enduser to explicitly input the percent or currency symbol when using type="percent" or type="currency".

Faces#isRequestSecure()/Servlets#isSecure() has been added which also checks the de-facto X-Forwarded-Proto header which returns the protocol as obtained by the proxy. Useful in case the server runs HTTP but proxy runs HTTPS.

Under the covers, many things are replaced by new JSF 2.3 API things (among others, a bunch of new constants, improved faces wrappers and ResourceHandler#markResourceRendered() / isResourceRendered()) and also Java8 lambdas and streams have been introduced where possible.

Deprecated things:

<o:commandScript> has been deprecated as it's now moved into JSF 2.3 as <h:commandScript> with exactly the same functionality.

fixviewstate.js has been deprecated as it's now finally solved in JSF 2.3 (by yours truly).

<o:form includeViewParams="true"> as well as <o:form includeRequestParams="true"> have been deprecated as those have never proven to be more useful than useRequestURI="true".

Noted should be that the <o:socket> is also moved into JSF 2.3 as <f:websocket> with here and there a few small API generifications. But this won't be deprecated anywhere in OmniFaces 3.x as it still has room for new ideas and improvements.

Installation

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

About

Donate

For the ones who want to express their excessive thanks for my work, I used to have an Amazon wishlist with a list of books, but right now I don't have any interesting books on the list anymore (to anyone who've sent books before: thank you very much, I got 6 books in 6 months). You can always donate something so that I can use it for other stuff, such as Nespresso coffee.