shuzheng hace 9 años
padre
commit
3606bed771

+ 12 - 0
cms/cms-web/src/main/java/com/zheng/cms/controller/CacheController.java

@@ -1,5 +1,6 @@
 package com.zheng.cms.controller;
 package com.zheng.cms.controller;
 
 
+import com.zheng.cms.service.UserService;
 import com.zheng.common.util.EhCacheUtil;
 import com.zheng.common.util.EhCacheUtil;
 import com.zheng.common.util.PropertiesFileUtil;
 import com.zheng.common.util.PropertiesFileUtil;
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.Cache;
@@ -7,6 +8,7 @@ import net.sf.ehcache.CacheManager;
 import net.sf.ehcache.Element;
 import net.sf.ehcache.Element;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.ResponseBody;
@@ -26,6 +28,16 @@ public class CacheController {
 
 
 	private final static String EHCACHE_NAME = PropertiesFileUtil.getInstance().get("ehcache");
 	private final static String EHCACHE_NAME = PropertiesFileUtil.getInstance().get("ehcache");
 
 
+	@Autowired
+	private UserService userService;
+
+	@RequestMapping("/test")
+	@ResponseBody
+	public Object test(HttpServletRequest request) {
+		System.out.println(System.getProperty("java.io.tmpdir"));
+		return "success";
+	}
+
 	/**
 	/**
 	 * 新增缓存记录
 	 * 新增缓存记录
 	 * @param request
 	 * @param request

+ 3 - 0
cms/cms-web/src/main/resources/springMVC-servlet.xml

@@ -8,6 +8,9 @@
         http://www.springframework.org/schema/mvc
         http://www.springframework.org/schema/mvc
         http://www.springframework.org/schema/mvc/spring-mvc.xsd">
         http://www.springframework.org/schema/mvc/spring-mvc.xsd">
 
 
+	<!-- 根目录'/'对应页面 -->
+	<mvc:view-controller path="/" view-name="/index"/>
+
 	<!-- 拦截器配置 -->
 	<!-- 拦截器配置 -->
 	<mvc:interceptors>
 	<mvc:interceptors>
 		<!-- 后台拦截器 -->
 		<!-- 后台拦截器 -->

+ 2 - 2
cms/cms-web/src/main/webapp/WEB-INF/jsp/index.jsp

@@ -3,8 +3,8 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <head>
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
-<title>首页</title>
+    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
+    <title>首页</title>
 </head>
 </head>
 <body>
 <body>
 首页
 首页

+ 1 - 3
cms/cms-web/src/main/webapp/WEB-INF/web.xml

@@ -27,9 +27,7 @@
 	<context-param>
 	<context-param>
 		<param-name>contextConfigLocation</param-name>
 		<param-name>contextConfigLocation</param-name>
 		<param-value>
 		<param-value>
-			classpath:applicationContext.xml,
-			classpath:applicationContext-jdbc.xml,
-			classpath:applicationContext-ehcache.xml
+			classpath*:applicationContext*.xml
 		</param-value>
 		</param-value>
 	</context-param>
 	</context-param>
 
 

+ 0 - 5
cms/cms-web/src/main/webapp/index.jsp

@@ -1,5 +0,0 @@
-<html>
-<body>
-<h2>Hello World!</h2>
-</body>
-</html>