修改配置

This commit is contained in:
shuzheng 2016-10-19 16:57:14 +08:00
parent cccdac47b5
commit 3606bed771
5 changed files with 18 additions and 10 deletions

View File

@ -1,5 +1,6 @@
package com.zheng.cms.controller;
import com.zheng.cms.service.UserService;
import com.zheng.common.util.EhCacheUtil;
import com.zheng.common.util.PropertiesFileUtil;
import net.sf.ehcache.Cache;
@ -7,6 +8,7 @@ import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@ -26,6 +28,16 @@ public class CacheController {
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

View File

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

View File

@ -3,8 +3,8 @@
<!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">
<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>
<body>
首页

View File

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

View File

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