You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2018/01/19 14:09:52 UTC
[incubator-servicecomb-java-chassis] branch master updated: SCB-253
make integrate with spring-webmvc view simpler
This is an automated email from the ASF dual-hosted git repository.
ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new 3223a2f SCB-253 make integrate with spring-webmvc view simpler
3223a2f is described below
commit 3223a2f86665e30818d2023c1a4300dce59cd82f
Author: wujimin <wu...@huawei.com>
AuthorDate: Thu Jan 18 11:45:56 2018 +0800
SCB-253 make integrate with spring-webmvc view simpler
---
.../transport-rest/transport-rest-servlet/pom.xml | 2 +-
.../rest/servlet/CseDispatcherServlet.java | 31 ++++++++++++++++++++++
.../rest/servlet/CseXmlWebApplicationContext.java | 3 +++
3 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/transports/transport-rest/transport-rest-servlet/pom.xml b/transports/transport-rest/transport-rest-servlet/pom.xml
index ae1423d..03d527c 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 0000000..1b2ad70
--- /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 5bf978c..ee2fa2c 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 @@ public class CseXmlWebApplicationContext extends XmlWebApplicationContext {
private String defaultBeanResource = BeanUtils.DEFAULT_BEAN_RESOURCE;
+ public CseXmlWebApplicationContext() {
+ }
+
public CseXmlWebApplicationContext(ServletContext servletContext) {
setServletContext(servletContext);
}
--
To stop receiving notification emails like this one, please contact
['"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>'].