I am using Spring MVC 3.0. I have created an annotation based controller and it is working fine.
I have a requirement to get the controller bean from the application context.
I have tried with ApplicationContextAware and I am able to get the bean, but If I try with following code, its failing. The requirement is that, I need to do this way.
Need help on the same.
WebApplicationContext appContext = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
System.out.println("RegistrationComponentController : " + ctx.containsBean("beanName"));