I want to display java arraylist into JSF page. I generated arraylist from database. Now I want to display the list into JSF page by calling the list elements index by index number. Is it possible to pass a parameter to bean method from an EL expression in JSF page directly and display it?
I want to display java arraylist into JSF page. I generated arraylist from database.
Share
You can access a list element by a specific index using the brace notation
[].As to parameter passing, surely it’s possible. EL 2.2 (or JBoss EL when you’re still on EL 2.1) supports calling bean methods with arguments.
See also:
I however wonder if it isn’t easier to just use a component which iterates over all elements of the list, such as
<ui:repeat>or<h:dataTable>, so that you don’t need to know the size beforehand nor to get every individual item by index. E.g.or
See also: