It's not a secret anymore!
The moose likes Struts and the fly likes Nested LazyBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Nested LazyBean" Watch "Nested LazyBean" New topic

Nested LazyBean

Whitney Albrecht

Joined: May 09, 2005
Posts: 19
I have tried implementing the NestedLazy Bean from:

However when I try to do something similar to the Order Book bean I get run into errors.

The first problem I run into is that since the customer does not exist (yet) I get a null returned from the following line:
DynaBean customer = (DynaBean)orderBook.get("customer", c);

So then I added a set method before the get;

orderBook.set("customer", c);
DynaBean customer = (DynaBean)orderBook.get("customer", c);

but ran when running the code ran into the ClassCastException error; which is thrown by the get line.

Has anyone been sucessful in using Nested Lazy beans? What am I missing or setting up wrong?

Thanks for you advice in advance.
[ September 09, 2005: Message edited by: Whitney Albrecht ]
I agree. Here's the link:
subject: Nested LazyBean
It's not a secret anymore!