Spring MVC - Register New Controllers programatically [message #987410] |
Mon, 26 November 2012 09:04  |
Eclipse User |
|
|
|
Hi all. Im working on a project that I will need to deploy new webservices endpoints dinamically, and also, redeploy this webservices in version updates, etc.
I'm thinking in deploy this webservices (Simple controllers acting as restful) as bundles. So, my idea is write a central Web Bundle, and the endpoints that will only have controllers, will consume services from the OSGi context, ant will be attached to this web bundle context.
Can I do something like that? How can I register and unregister the controllers programatically under the Spring front servlet controller (org.springframework.web.servlet.DispatcherServlet) that will be created on the WebBundle?
Any ideas?
Thanks!
|
|
|
|
Re: Spring MVC - Register New Controllers programatically [message #987743 is a reply to message #987729] |
Tue, 27 November 2012 16:11   |
Eclipse User |
|
|
|
Hi Dmitry! Thanks by your help!
How can snaps run with Spring MVC? In that case, I can only have one Dispatcher Servlet right?
My major problem, is that I need to register and unregister controllers.
The only way I found to implement it, is adding the controllers to the WebBundle application context, and Subclass DefaultAnnotationHandlerMapping, to invoke a protected method that searches for Controllers on the Context.
To unregister, I need to unregister the Controllers from context, refresh.
I dont like this approach .
Is Virgo Snaps aware of SpringMVC, and can it automate discovery of new controllers to the main Dispatcher servlet? Or I can create one dispatcher per snap, as totally independent application?
Sorry by the ammount of questions !
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04253 seconds