[SWS-832] Add support for programmatically instantiating MessageDispatcherServlet Created: 30/Apr/13 Updated: 03/Jul/13 Resolved: 02/Jul/13
|Project:||Spring Web Services|
|Component/s:||Core, Documentation, OXM, Samples, Security, Test|
|Reporter:||Mark Diskin||Assignee:||Arjen Poutsma|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
The current MessageDispatcherServlet does not support a pure code configuration (no web.xml) as it does not offering a way of passing the 'root' Spring application context when the dispatcher servlet is created. For the normal Spring MVC DispatcherServlet there is a constructor with a WebApplicationContext parameter (added in 3.1.x I believe) and the 'root' app context can be passed on using this parameter.
Additionally there code be some review of the current schema namespaces to see if they are appliable as annotation classes. All of this would need the samples, documentation to be updated.
Below is a way to get the core javaconfig to work with the existing springws release (but still need the web.xml)
|Comment by Marten Deinum [ 29/May/13 ]|
The DispatcherServlet only has an option to pass in the ApplicationContext to use, not the root context (see: http://static.springsource.org/spring/docs/3.2.x/javadoc-api/org/springframework/web/servlet/DispatcherServlet.html#DispatcherServlet(org.springframework.web.context.WebApplicationContext) for more information).
You still don't need a web.xml you can pass in all the attributes as properties to the MessageDispatcherServlet.
|Comment by Nick Williams [ 13/Jun/13 ]|
Pull request submitted.
Added Java configuration support to MessageDispatcherServlet so that it can be configured within a ServletContextListener or a ServletContainerInitializer.
The change was extremely minor. Biggest change is the Javadoc. I added a new constructor to call FrameworkServlet#FrameworkServlet(WebApplicationContext) and then copied the JavaDoc from FrameworkServlet to the new constructor (exactly like it was done in DispatcherServlet). Works great!
What's the roadmap for 2.1.4? I'd love to see this committed and 2.1.4 rolled out soon.
I have signed and agree to the terms of the SpringSource Individual Contributor License Agreement.
|Comment by Arjen Poutsma [ 02/Jul/13 ]|
Related git pull request at https://github.com/SpringSource/spring-ws/pull/3
|Comment by Nick Williams [ 02/Jul/13 ]|
I see you renamed this from "Add Java Config Support" to "Add support for programmatically instantiating MessageDispatcherServlet." This is accurate, to be sure, in describing my commit. However, the original request was for full Java configuration support, which this doesn't achieve. If you're going to rename this issue, it seems that another issue (enhancement) should be created for full Java configuration support.