Rick Reumann wrote:
On 8/23/05, *CONNER, BRENDAN (SBCSI)* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
As another alternative, the practice we've been following is to
have an
XyzAction class and a separate XyzBean class. The Action class has a
managed reference to the Bean class and has all the logic in it. The
Bean class is just a straight JavaBean and contains all the data
needed
by the JSF page.
Are you stating to register both as managed beans? Currently I do have
two separate classes (XyzAction and XyzBean, but XyzBean is nested
inside the backing bean XyzAction). Using the approach above my
question is best illustrated by an example...
In XyzAaction:
XyzBean getXyz {
return backendDelegate.getXyz();
}
My question is how do I now refrence XyzBean from the JSP (using your
separate managed bean approach)? If I do xyz.name <http://xyz.name>
how is it pulling the reference to getXyz? In other words, even if I
set XyzBean as a managed request scope bean how would this bean have
gotten set from the XyzAction in order to be available on the page?
I'm used to typical webapps where I stick stuff into the request from
servlets (actions in struts). In this scenario above I have not idea
how a separate managed XyzBean will be populated from a totally
separate managed bean?
Can someone provide a concrete example of this usage? I'd love to see
a demo app with this approach. thanks.
Rick Hightower does this in his "Clearing the FUD about JSF"
http://www-128.ibm.com/developerworks/java/library/j-jsf1/
He has the XyzBeand and XyzController with the controller containing:
XyzBean xyzBean = new XyzBean();
and then supporting the methods etc. via xyzBean.method() calls. His
Controller is your Action.
See his extremely fine articles for more details.
-david-