Here
<h:dataTable value="#{actividades.getAll}" var="actividad">
Your EL expression is not valid. It is looking for the getGetAll() method, but you only have the getAll() method representing the getter for the (dummy) all property. The property does not have to exist (it must be private anyway).
So, to fix your problem, it must be
<h:dataTable value="#{actividades.all}" var="actividad">
or if you are using EL 2.2 (but this method is not recommended)
<h:dataTable value="#{actividades.getAll()}" var="actividad">
In any case, he will choose the correct getAll() method.
Unrelated to a specific problem, you have, by the way, another design flaw in your code. A getter is called as many times as EL is required. Doing work with database / database access inside the getter method is a bad idea. The getter is supposed to simply return bean properties. Rather, move the database to the bean (post) constructor.
private List<Actividad> all; @PostConstruct public void init() { all = actividad.getAll(); } public List<Actividad> getAll(){ logger.trace("ActividadesController.getAll"); return all; }
See also:
source share