Hello,
I have a problem calling action-servlet defined beans from listener.
I'm using AppFuse example application. I want to call a bean defined in action-servlet.xml in StartupListener.
StartupListener can be found here: java/fidD72C97... =WebCtxLoader
action-servlet.xml here: browse/~ra...on-servlet.xmlI have added to action-servlet.xml my bean definition:
lt;bean id=quot;myBeanquot; class=quot;com.ttt.webapp.action.MyBeanquot;gt; lt;property name=quot;mgrquot; ref=quot;productInformationManagerquot;/gt; lt;/beangt;
If I just make a reference in StartupListener to bean:
LookupManager mgr = (LookupManager) ctx.getBean(quot;myBeanquot;);
I get ERROR:
NoSuchBeanDefinitionException: No bean named 'myBean' is definedIf I make a reference to bean defined on applicationContext-Service.xml, then of course it works fine.
But it's web layer related bean and I need to defne this bean in action-servlet.xml, so how can I make this to work?
Thank before hand! |