Can I use Spring MVC and Spring WS in one single application?

半世苍凉 提交于 2019-11-28 19:31:50

Yes, this is fine. You put the MVC-related stuff into one, and the WS stuff into another.

If they need to share services, then it's best to declare a shared context using ContextLoaderListener in web.xml, which defines a third context which should contain the shared beans (see docs for example of how to set this up).

It's also worth nothing that MessageDispatcherServlet is just a convenient assembly of a standard DispatcherServlet plus a few other components. You can just declare those components yourself and use a DispatcherServlet, but that gets quite fiddly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!