JSF 2.3 comes with @ManagedProperty compatible with CDI
The JSF managed bean annotations will be deprecated in JSF 2.3. This includes @ManagedProperty as well. But, compared to other annotations, this one has got an implementation that can be used with CDI...
View ArticleJSF 2.3 - The JSF managed bean annotations deprecated
Starting with JSF 2.3 the JSF "native" managed bean annotations are officially deprecated. So, there is no doubt now that CDI is the road to follow :)
View ArticleJavaServer Faces 2.3: What's Coming by Arjan Tijms
If you like this article, I think you are going to like JSF 2.3 Tutorial as well.
View Article[OmniFaces utilities (2.4)] Format the given number to nearest 10^n (rounded...
[OmniFaces utilities] The formatThousands() formats the given number to nearest 10n (rounded to thousands), immediately suffixed (without space) with metric unit (k, M, G, T, P or E), rounding half up...
View Article[OmniFaces utilities (2.4)] Format the given number to nearest 10^n, suffixed...
[OmniFaces utilities] The formatThousandsUnit() formats the given number to nearest 10n (rounded to thousands), suffixed with a space, the metric unit prefix (k, M, G, T, P or E) and the given unit,...
View Article[OmniFaces utilities (2.4)] Get all request query string or view parameters...
[OmniFaces utilities] The getParams() returns an unmodifiable map with all request query string or view parameters, appended with all child UIParameter components (<f|o:param>) of the given...
View Article[OmniFaces utilities (2.4)] Get the HTTP request URL with query string,...
[OmniFaces utilities] The getRequestURL() method returns the HTTP request URL with query string, regardless of any forward. This is the full request URL without query string as the enduser sees in...
View Article[OmniFaces utilities (2.4)] Get the HTTP request query string, regardless of...
[OmniFaces utilities] The getRequestQueryString() method returns the HTTP request query string, regardless of any forward.Method:Use this one outside JSF context(Servlets#getRequestQueryString())See...
View Article[OmniFaces utilities (2.4)] Get the HTTP request URI, regardless of any...
[OmniFaces utilities] The getRequestURI() method returns the HTTP request URI, regardless of any forward or error dispatch. This is the part after the domain in the request URL, including the leading...
View Article[OmniFaces utilities (2.4)] Get a list of all action expressions and...
[OmniFaces utilities] The getActionExpressionsAndListeners() method returns a list of all action expressions and listeners associated with given component. This covers expressions in action attribute...
View Article[OmniFaces utilities (2.4)] Get the source of the currently invoked action
[OmniFaces utilities] The getCurrentActionSource() method returns the source of the currently invoked action, or null if there is none, which may happen when the current request is not a postback...
View ArticleCDI-JSF: Beans discovery modes
When we write applications that involves CDI we need to activate CDI by adding in our project a file named beans.xml. Usually, this file will look like below:<?xml version="1.0"...
View Article[OmniFaces utilities (2.4)] Create a copy of the array with items in reversed...
[OmniFaces utilities] The reverseArray() function returns a copy of the array with items in reversed order.Function:Usage:Let's suppose that we have the following simple array defined in a...
View ArticleJSF 2.3 - Import constants/enums
Let's checkout a common practice for declaring constants in Java using the public static final declaration:public class Circle { private static final float PI = 3.14f; private static final String UNIT...
View Article[OmniFaces utilities 2.4] Check if the given object is serializable
[OmniFaces utilities] The isSerializable() method returns true if the given object is serializable.Method:Usage:Example 1 - test Object:import org.omnifaces.util.Utils;...Utils.isSerializable(new...
View ArticleJSF 2.3 Auto detect Converter based on 1st UISelectMany item
Starting with JSF 2.3, more exactly with m07, we can take advantage of using the auto detection of convertors based on 1st UISelectMany item.The story behind the issue solved in JSF 2.3 is easy to...
View Article