http://www.java-allandsundry.com/2011/06/supporting-spring-ws-and-spring-mvc.html
Spring WS and Spring MVC provide different front controller implementations as a gateway to the webservice and the MVC functionality respectively. The Dispatcher Servlet used by Spring-WS is :
view sourceprint?
org.springframework.ws.transport.http.MessageDispatcherServlet
and the one used by Spring MVC is :
view sourceprint?
org.springframework.web.servlet.DispatcherServlet
To have a combined Spring MVC and Spring-WS project, it is possible to configure these front controllers based on the URI pattern of the request, in the following way:
view sourceprint?
<servlet>
<servlet-name>member-ws</servlet-name>
<servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/META-INF/spring/applicationContext-ws.xml</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>member-web</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/webmvc-config.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>member-ws</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>member-ws</servlet-name>
<url-pattern>*.wsdl</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>member-web</servlet-name>
<url-pattern>/web/*</url-pattern>
</servlet-mapping>
In this specific instance, all requests to /web/ is handled by the Spring MVC DispatcherServlet whereas all requests to /services is handled by Spring-WS DispatcherServlet. Further, each dispatcher servlet is configured with its custom Spring configuration file, the one for Spring MVC loads up the contollers, the one for Spring WS loads up the Webservice endpoints.
I am not sure if this is a optimal configuration, but it works for me in this project available at: git://github.com/bijukunjummen/memberservice-contractfirst.git
OR An alternate way to hook up DispatcherServlet to handle Spring-WS requests is described here!: http://static.springsource.org/spring-ws/sites/2.0/reference/html/server.html#d4e884
分享到:
相关推荐
40. Spring Integration 41. Spring Session 42. Monitoring and Management over JMX 43. Testing 43.1. Test Scope Dependencies 43.2. Testing Spring Applications 43.3. Testing Spring Boot Applications 43.3...
MOHANIBM Almaden Research CenterandDON HADERLEIBM Santa Teresa LaboratoryandBRUCE LINDSAY, HAMID PIRAHESH and PETER SCHWARZIBM Almaden Research CenterIn this paper we present a simple and efficient ...
Volume 1: Describes the architecture and programming environment of processors supporting IA-32 and Intel® 64 architectures. Volume 2: Includes the full instruction set reference, A-Z. Describes the...
One of the first (if not the ... Frameworks built on top of the Spring framework have emerged supporting application integration, batch processing, Flex and Flash integration, GWT, OSGi, and much more.
Volume 1: Describes the architecture and programming environment of processors supporting IA-32 and Intel® 64 architectures. Volume 2: Includes the full instruction set reference, A-Z. Describes ...
The code in this document augments TPM 2.0 Part 2 and TPM 2.0 Part 3 to provide a complete description of a TPM, including the supporting framework for the code that performs the command actions. ...
### 关于NVIDIA TX1支持实时计算机视觉工作负载的研究 #### 概述 本文献评估了NVIDIA Jetson TX1平台在支持实时计算机视觉任务中的有效性。随着自动驾驶汽车等前瞻性安全关键系统的出现,如何在严格的尺寸、重量和...
[1] This paper will provide such a project model and is donated to the FreeBSD Documentation project where it can evolve together with the project so that it can at any point in time reflect the way ...
Volume 1: Describes the architecture and programming environment of processors supporting IA-32 and Intel 64 architectures. Volume 2: Includes the full instruction set reference, A-Z, in one volume. ...
Supporting STEM education initiatives, computer coding teaches kids how to think creatively, work collaboratively, and reason systematically, and is quickly becoming a necessary and sought-after skill...
2.5 使用Spring IDE的Bean-supporting特性 2.5.1 问题描述 2.5.2 解决方案 2.5.3 实现方法 2.6 小结 第3章 Spring中的Bean配置 3.1 在Spring IoC容器里配置Bean 3.1.1...
2.5 使用Spring IDE的Bean-supporting特性 2.5.1 问题描述 2.5.2 解决方案 2.5.3 实现方法 2.6 小结 第3章 Spring中的Bean配置 3.1 在Spring IoC容器里配置Bean 3.1.1...
2.5 使用Spring IDE的Bean-supporting特性 2.5.1 问题描述 2.5.2 解决方案 2.5.3 实现方法 2.6 小结 第3章 Spring中的Bean配置 3.1 在Spring IoC容器里配置Bean 3.1.1 问题...
Directed-hypergraph based E-learning Process Modeling supporting Dynamic-Personalized-Combined Resource Optimization
**Ecosystem Maturity**: The LTE ecosystem is well-established, with a large number of device manufacturers and network operators supporting the technology. In contrast, WiMAX has struggled to gain ...
Supporting Power Management in Applications, Device Drivers, and in the OEM Adaptation Layer (OAL)** - Understanding the power management features available in Windows Embedded CE. - Techniques for...