WillemJiang closed pull request #517: [SCB-253] make integrate with
spring-webmvc view simpler
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/517
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/transports/transport-rest/transport-rest-servlet/pom.xml
b/transports/transport-rest/transport-rest-servlet/pom.xml
index ae1423d36..03d527c70 100644
--- a/transports/transport-rest/transport-rest-servlet/pom.xml
+++ b/transports/transport-rest/transport-rest-servlet/pom.xml
@@ -35,7 +35,7 @@
<dependency>
<groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
+ <artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.apache.servicecomb</groupId>
diff --git
a/transports/transport-rest/transport-rest-servlet/src/main/java/org/apache/servicecomb/transport/rest/servlet/CseDispatcherServlet.java
b/transports/transport-rest/transport-rest-servlet/src/main/java/org/apache/servicecomb/transport/rest/servlet/CseDispatcherServlet.java
new file mode 100644
index 000000000..1b2ad7000
--- /dev/null
+++
b/transports/transport-rest/transport-rest-servlet/src/main/java/org/apache/servicecomb/transport/rest/servlet/CseDispatcherServlet.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.transport.rest.servlet;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.servlet.DispatcherServlet;
+
+public class CseDispatcherServlet extends DispatcherServlet {
+ private static final long serialVersionUID = 5755456289644038012L;
+
+ @Override
+ protected WebApplicationContext
createWebApplicationContext(ApplicationContext parent) {
+ setContextClass(CseXmlWebApplicationContext.class);
+ return super.createWebApplicationContext(parent);
+ }
+}
diff --git
a/transports/transport-rest/transport-rest-servlet/src/main/java/org/apache/servicecomb/transport/rest/servlet/CseXmlWebApplicationContext.java
b/transports/transport-rest/transport-rest-servlet/src/main/java/org/apache/servicecomb/transport/rest/servlet/CseXmlWebApplicationContext.java
index 5bf978c02..ee2fa2c04 100644
---
a/transports/transport-rest/transport-rest-servlet/src/main/java/org/apache/servicecomb/transport/rest/servlet/CseXmlWebApplicationContext.java
+++
b/transports/transport-rest/transport-rest-servlet/src/main/java/org/apache/servicecomb/transport/rest/servlet/CseXmlWebApplicationContext.java
@@ -37,6 +37,9 @@
private String defaultBeanResource = BeanUtils.DEFAULT_BEAN_RESOURCE;
+ public CseXmlWebApplicationContext() {
+ }
+
public CseXmlWebApplicationContext(ServletContext servletContext) {
setServletContext(servletContext);
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services