I am using ArrayUtils from apache to do this.
first, register the ArrayUtils class as a bean so you can access it from EL.
<managed-bean>
<managed-bean-name>arrayUtils</managed-bean-name>
<managed-bean-class>org.apache.commons.lang3.ArrayUtils</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
then you can call ArrayUtils' methods:
#{myBean.aMethod(arrayUtils.add(ArrayUtils.EMPTY_INT_ARRAY, 1))}
the above code will not work if you can't access the constant EMPTY_INT_ARRAY. To this, i used primefaces p:importConstants component, not sure if can be done in plain JSF.
this is how i use it:
<p:importConstants type="org.apache.commons.lang3.ArrayUtils" var="ArrayUtils" />
of:createArray
:) – Gillian