Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JSF中的页面加载事件_Jsf_Jsf 2_Primefaces_Onload_Onload Event - Fatal编程技术网

JSF中的页面加载事件

JSF中的页面加载事件,jsf,jsf-2,primefaces,onload,onload-event,Jsf,Jsf 2,Primefaces,Onload,Onload Event,我试图在页面加载期间为下拉列表赋值。我遵循了这个链接中给出的方法 根据链接,我尝试使用注释和构造函数类型 但这对我来说是个例外 SEVERE: An exception occurred javax.faces.FacesException: java.lang.reflect.InvocationTargetException Caused by: java.lang.reflect.InvocationTargetException Caused by: javax.el.ELE

我试图在页面加载期间为下拉列表赋值。我遵循了这个链接中给出的方法

根据链接,我尝试使用注释和构造函数类型

但这对我来说是个例外

 SEVERE: An exception occurred
 javax.faces.FacesException: java.lang.reflect.InvocationTargetException

 Caused by: java.lang.reflect.InvocationTargetException
 Caused by: javax.el.ELException: Detected cyclic reference to managedBean loginBean
 Caused by: javax.faces.el.EvaluationException: Detected cyclic reference to managedBean loginBean
我刚刚试着在带注释的方法或构造函数中调用一个函数, 就是

     @PostConstruct
public void init()
{
receiveclass r=new receiveclass();
r.retrieve();

} 
我想不出这个问题

检测到对managedBean loginBean的循环引用


您正在将两个不同的托管bean作为
@ManagedProperty
相互注入。这是不允许的。应该是单向注射。删除引用另一个bean中的一个bean的
@ManagedProperty

ya我使用了另一个bean类,但我不能为它使用任何托管属性,“receiveclass”是我的下一个bean类,我使用retrieve()方法返回元素列表。我在同一个类中还有另一个方法,用于在触发submit方法时插入值。即使我在删除托管bean后也尝试过,但它仍然会遇到相同的错误。“检测到对managedBean loginBean的循环引用”。也许您在
faces config.xml