This explains the reason of the exception I ran into.
Now my question is
(1) Why BSFFunctions doesn't support the getObjectRegistry method?
(2) How can I retrieve the bean objects from the ObjectRegiestry inside the script code?
For the try case 1, I got this error:
TypeError: Cannot find function getObjectRegistry. although I can directly call
Although I can run the following code successfully in my java code:
Object obj = manager.getObjectRegistry().lookup( BEAN_NAME );
For the case 2, I got a java.lang.ClassCastException, here is part of my printstacktrace:
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
For the case 3, I know conceptly it not the right way to do, just use it to confirm my understanding. As expected, it gave me exception of "myBeanName" is not defined.
Conceptually, I think the case 1 here is the right way to do it, but why it didn't work?
"Rony G. Flatscher" wrote:
// ... do whatever you need to do (setup, invoking scripsts, maybe
// or if you want to use bm's ObjectRegistry object as a parent:
// do whatever you need to do with "or" (registering objects for the
bm.setObjectRegistry(or); // now set "bm" to the new
ObjectRegistry object "or"
// continue to invoke scripts
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.
Everyone is raving about the all-new Yahoo! Mail beta.