Hi, I'm working on a project using Jsf.
The problem is that when calling a method of a Bean for example #{pruebaBean.test()}
only returns the result correctly on the first page that executes the project, that is, the default page set in web.xml
, when changing pages just return #{prueba.test()}
as is.
I have a configuration file of the beans face-config.xml
with the following:
<managed-bean>
<managed-bean-name>pruebaBean</managed-bean-name>
<managed-bean-class>Beans.PruebaBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
and a simple and basic Bean test:
public class PruebaBean implements Serializable {
/**
* Creates a new instance of UsuarioBean
*/
public PruebaBean() {
}
public String test(){
return "prueba";
}
}
I assume that something is missing in the configuration to cover all the pages, but I do not know what it is, if you help me, I would appreciate it.