[1] Do you mean instantiated or accessed? You can access a managed bean from
anyother managed bean using. If the bean is not already in scope it will be
instantiated
protected Object getValue(String expr) {
ValueBinding vb = getApplication().createValueBinding(expr);
return (vb.getValue(getFacesContext()));
}
We use a base class for session beans and provide quickaccess to named
beans. This is very similar to how Sun's Creator 1 was organized.
[2] You might have more luck using a filter and/or listeners to handle
re-directs and session management. You should find some links on this in
this and other discussion boards.
-----Original Message-----
From: Ondrej Svetlik [mailto:[EMAIL PROTECTED]
Sent: Friday, May 26, 2006 11:10 AM
To: MyFaces Discussion
Subject: Bean instantiation and dispatching
Hello all,
I have two problems:
1. I have several managed-beans and I access one of them (session
scoped) from the others. I need it to be instantiated on every page even
when it is not referenced there. Is there any possibility to do it?
2. Another request scoped bean is used to control access. It also access the
first bean to check whether the user is logged in and it should redirect to
login page in case the user is not logged in. I tried to use
ExternalContext.dispatch() but I got an exception saying that flush cannot
be called inside custom tags. Any ideas?
Thanks for any help, link or idea.
Best regards
Ondrej Svetlik