Page On load event in JSF

2019-08-22 03:43发布

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条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-08-22 04:40

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.

查看更多
登录 后发表回答