how can I pass a List to a JSF-Component in EL without a backingbean? Or in other words how can I declare and initialize a List/Array in JSF without a bean?
Example:
caller.xhtml
/* Call a JSF-Component */
<mycomp:displayList value="HERE I WANT TO PASS A LIST WITHOUT A BACKINGBEAN"/>
displayList.xhtml
/* MY Component */
<composite:interface>
<composite:attribute name="value" type="java.util.list" />
</composite:interface>
Is there any possibility to pass a List/Collection which is not declared in a Bean to a JSF component?
Although there is no list literal in EL, you can declare a list without requiring a bean to contain it by declaring one in faces-config.xml:
You can also use a utility type to build a list:
This can be used with an expression like
#{lister.plus('one').plus('two').plus('three')}