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 byexecute
attribute of<f:ajax>
will be sent, hereby reducing the request payload to not contain unnecessary parameters. This is similar to PrimeFacespartialSubmit
feature. You can if necessary disable this by<o:form partialSubmit="false">
.<o:validateBean showMessageFor="@violating">
will not anymore show the "remaining" messages (coming from other bean properties which are not covered by the JSF form) as a global message but just suppress them.ValidateMultipleFields
(all multi-field validators basically) have previously skipped all disabled/readonly/nonrendered inputs. Now they won't anymore be skipped, and thevalues
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 toorg.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 threwIOException
will now throw Java8'sjava.io.UncheckedIOException
instead, hereby reducing down unnecessarythrows IOException
boilerplate in methods because those should always be bubbled up into the container. org.omnifaces.facesviews.FacesServletDispatchMethod
andViewHandlerMode
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 withorg.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 bakeSelectItemGroup/SelectItem[]
instances in beans as there's (still) no corresponding tag in standard JSF for this.<o:url>
has been extended with avalue
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 usingtype="percent"
ortype="currency"
.org.omnifaces.eventlistener.FacesRequestLogger
phase listener is introduced which will print detailed logs of JSF requests, including request method/URI/params, session/viewstate ID, remote user, action method expressions, faces messages and phase timings.Faces#getRequestAttribute()/getFlashAttribute()/getViewAttribute()/getSessionAttribute()/getApplicationAttrubute()
got an overload which takes a new argument representing the supplier which will be computed in case the attribute is absent.Faces#isRequestSecure()
/Servlets#isSecure()
has been added which also checks the de-factoX-Forwarded-Proto
header which returns the protocol as obtained by the proxy. Useful in case the server runs HTTP but proxy runs HTTPS.#{of:isInstance('com.example.ClassName', object)}
has been added to act asinstanceof
in EL.#{of:parenthesize(object)}
has been added which will print parenthesis around the given object only and only if it isn't null nor empty nor equals zero.NoAutoGeneratedIdViewHandler
will now also recognizeprependId="false"
and log a warning because this is bad practice.- 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 thanuseRequestURI="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.
Maven users: use <version>3.0-RC2</version>
.
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>3.0-RC2</version>
</dependency>
If you have found any issues or comments related to above listed changes, please by all means report an issue.
No comments:
Post a Comment