I am developing with JSF, Spring and hibernate and I can not create a Controller with my own methods to be able to call them from the xhtml, this is my code
HomeController.java
@ManagedBean
public class HomeController implements Serializable{
private static final Logger log = LoggerFactory.getLogger(HomeController.class);
private static final long serialVersionUID = 1L;
private String descripcion;
public HomeController() {
this.descripcion = "OK";
}
public String getDescripcion() {
return this.descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
public void UserLog(){
log.info("somethings");
}
}
home.xhtml
<h:commandButton value="#{HomeController.descripcion}" action="# {HomeController.UserLog()}"/>
But it does not work.