It’s a fact! OmniFaces is growing and it becomes even more popular each day, which is a good thing, since as you will discover in this blog, OmniFaces is not just a utility library for JSF applications, but also a GREAT source of inspiration for every JSF developer (see OmniFaces source code – it contains powerful techniques)!
Regarding to its current release, OmniFaces comes with the following improvements:
Major in OmniFaces 2.0
- Dependencies are changed from Java 1.6, JSF 2.0, Servlet 2.5, EL 2.1 to Java 1.7, JSF 2.2, Servlet 3.0, EL 2.2 and CDI 1.1; as of now, OmniFaces 2.0 is still backwards compatible with JSF 2.1, but not with JSF 2.0 anymore
- OmniFaces initialization will explicitly fail if CDI BeanManager is unavailable application startup
- Events utility class has major method renames to clarify the meaning
- Beans utility class doesn't take BeanManager anymore as argument
Added in OmniFaces 2.0 (does NOT apply to OmniFaces 1.10)
- NoAutoGeneratedIdViewHandler which throws a runtime exception when an autogenerated JSF client ID is being rendered
- <o:viewParamValidationFailed> which enables sending either a redirect or error status on validation failure of view parameters
- <o:graphicImage> which is capable of referencing a byte[] or InputStream property with optional support for data URI format
- @Param now supports directly injecting the (auto-converted) value
- <o:moveComponent> via which components, facets and behaviors can be moved at runtime to a target component in various ways
- <o:resolveComponent> via which a component can be looked up by its ID and a reference to it put in various scopes
- <o:validateBean> now supports validating beans at the class level
- Servlets utility class got a bunch of new methods related to cookies and JSF
- New BeansLocal utility class next to Beans class with the same philosophy as Faces/FacesLocal
Changed in OmniFaces 2.0 (also applies to OmniFaces 1.10)
- Default validation message of ValidateMultipleFields components can now be supplied via <message-bundle>
- <o:viewParam> enables support for @NotNull and Pre/PostValidateEvent even when parameter is not specified, on contrary to <f:viewParam>
- Html5RenderKit is now not forgiving anymore on broken renderers that don't pass the current component to the write methods (fixes "plain HTML" mess-up)
- Skip null/empty values in <o:validateOrder> as that's actually the responsibility of required="true"
- CDNResourceHandler and CombinedResourceHandler can now be disabled via a web.xml context param supporting a request based EL expression
Fixed in OmniFaces 2.0 (also applies to OmniFaces 1.10)
- Set system default timezone in CDI @FacesConverter when web.xml context param says so
- Components#hasInvokedSubmit() failed in iterating components such as UIData and UIRepeat
- Fixed <o:massAttribute> to only consider own children instead of those of parent
- GzipResponseFilter is made better compatible with Servlet 3.1 containers
Major in OmniFaces 1.10
- All CDI specific features are removed, this version is specifically for OmniFaces 1.0-1.5 users on outdated environments who can't upgrade to 1.6 or newer due to conflicts in CDI; OmniFaces users who were already successfully using CDI on a JSF 2.1 environment should be able to effortlessly upgrade to OmniFaces 2.0
Sounds great! But how can I get my hands on this? Pretty simple! If you use Maven, then you can download OmniFaces 2.0 by adding the following in your pom.xml:
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>2.0</version>
</dependency>
Or, if you need OmniFaces without CDI dependency, you can add:
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>1.10</version>
</dependency>
For non-Maven users, OmniFaces 2.0 jar is available here, while OmniFaces 1.10 here.
Niciun comentariu :
Trimiteți un comentariu