Hello everybody,
I am currently learning spring ( version 2.0.3 ) and getting a null pointer exception.
I have the following bean definitions in an application context:
The DefaultController class has the getter and setters for the manager.Code:<bean id="manager" class="business.Manager"> <bean id="defaultController" class="controller.DefaultController"> <property name="manager"> <ref bean="manager"/> </property> </bean> <bean id="firstController" class="controller.FirstController"/>
The FirstController class looks like :
Now when I access the myMethod from Manager class, it throws a null pointer. Am quite sure am doing some stupid, any suggestions ?Code:public class FirstController extends DefaultControllor implements Controller { public ModelAndView handleRequest ( HttpServletRequest request, HttpServletResponse response) { Manager mgr = getManager(); mgr.myMethod(); } }
Shouldn't the applicationContext intialize the manager object from the super class ?
thanks


Reply With Quote