PDA

View Full Version : Refresh WebApplicationContext doesn't reload Controllers


rstawarz
Mar 21st, 2006, 12:46 PM
I wanted to use the 'refresh' capabilities of the ApplicationContext in my WebApplication to propogate any property changes that may occur. I prototyped a quick application to test it out. I found that while the refresh is creating new beans, the DispatcherServlet is not picking up the updated handler/controller changes.

Has anyone else run into this?
Any ideas on how to make the DispatcherServlet reinitialize after the WebApplicationContext has been refreshed?

logan.johnson
Jun 20th, 2006, 05:12 PM
I've run into the same problem today.

My temporary (hideous) workaround is to inject the bean names into the controller, and have the controller call getApplicationContext().getBean(name). This way it doesn't matter that the DispatcherServlet holds onto the stale controller.