I\'d like to know if there\'s a way to bind the returned value of a method into a JSF component. I\'ll explain myself better. Let\'s say I have a class like this:
If you're running an EL 2.2 capable container (Tomcat 7, Glassfish 3, JBoss AS 6 or newer, all implementing Servlet 3.0), or are using JBoss EL, then you should be able to invoke non-getter methods by EL:
An alternative is to use JSTL fn:length():
...
If none of that is possible for you for some reason, then your best bet is to create an EL function yourself
or to add an extra getter method to #{myManagedBean} which returns exactly that.