Page On load event in JSF

ⅰ亾dé卋堺 提交于 2020-01-06 08:13:47

问题


I am trying to assign values to my dropdown during page load. I followed the way which is given in this link.

Invoke JSF managed bean action on page load

As per the link, i have tried using both the annotation and constructor type.

but its an exception for me,

 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

I have just tried to call a function, in that annotated method or constructor, that is,

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

} 

i cant able to figure out the problem.


回答1:


Detected cyclic reference to managedBean loginBean

You're injecting two different managed beans in each other as @ManagedProperty. This isn't allowed. It should be an one-way injection. Remove the @ManagedProperty referencing the one bean from the other bean.



来源:https://stackoverflow.com/questions/8008352/page-on-load-event-in-jsf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!