You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Mik Lernout <ml...@maketechnologies.com> on 2005/08/13 01:04:18 UTC

Circular dependencies in managed beans

Hey,

 

I have been using MyFaces and JSF for a couple of weeks now and am
wondering about an IoC specific issue that arises when using managed
beans. The basic issue is that, when I create a circular dependency
between two managed beans, I get StackOverflow errors. My beans are
declared in the JSF configuration as both having one managed-property of
which the value contains an EL expression pointing to the other bean.
(BTW: the two beans each back a page in a Master-Detail scenario and
need to pass some information to each other)

The stack trace seems to denote that the cause of this problem seems to
be the separation of the EL lookup and the ManagedBeanBuilder. As this
seems to be a pretty basic configuration, I am a bit flabbergast that
JSF trips on this. How should I solve this?

 

-mik

 

PS: Just to cut of that path: I do not want to call
FacesContext.getCurrentContext() to fill up the dependencies after the
setup was done. Apart from really hurting my Karma, it would also
destroy the POJO-ness of these components and make unit testing a whole
lot more difficult...

 

 

 

________________________________

Mik Lernout

MAKE Technologies Inc.

Email:

mik.lernout@maketechnologies.com
<ma...@maketechnologies.com> 

Visit:

www.maketechnologies.com <http://www.maketechnologies.com> 

Phone:

604.738.4999 xtn 119

Fax:

604.738.4979