> Thank you for you assistance.
You are very welcome, glad that I could help a little bit.
> I modified my code for the approach using manager.registerBean() :
> BSFManager manager = new BSFManager();
> manager.registerBean( "myBeanName", new MyBeanClazz("str for regBean");
> This time it works and printed out the string in the console. Thanks.
> But for my ObjectRegistery approach, even I tried to call bsf.lookupBean in the script code, it still doesn't work, anything still missing here?
Hmm, did you set the the ObjectRegistry object to your BSFManager's
Something along the lines:
// ... 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