PDA

View Full Version : Null ApplicationContext subclassing ApplicationObjectSupport



ultan
Sep 7th, 2004, 10:46 AM
I'm doing somthing wrong here :

If I subclass ApplicationObjectSupport and then in the subclass to a getApplicationContext() call shouldnt I receive the ApplicationContext object ?

Doing this I get a null. Do I need to do anything in config to make sure that a constructor other than the default is called, because this is whats happening ?

TIA

Colin Sampaleanu
Sep 8th, 2004, 08:25 AM
Are yoiu sure this object is being created inside an ApplicationContext, and not a plain BeanFactory?

ultan
Sep 9th, 2004, 09:18 AM
Im being dumb here then - is searchApplicationContext the only application context ? What about the others I define in the context param in the web.xml, or the view.xml I reference from the controller-servlet.xml file ?

(If I move the bean config from views.xml to searchApplicationContext, I get the app context ref as expected)

Colin Sampaleanu
Sep 9th, 2004, 04:32 PM
The context pointed to in web.xml is an ApplicationContext, yes. You'll have to clarify what you mean by searchApplicationContext. views.xml is I believe just a beanfactory, which is why you're getting the behaviour you describe...