springmvc配置Ehcache实现缓存管理

来源:互联网 发布:mysql 数据库重命名 编辑:程序博客网 时间:2024/05/20 04:46

springmvc配置Ehcache实现缓存管理

项目源代码:http://download.csdn.net/detail/u013147600/9066943


工程介绍:


springmvc结合Ehcache实现缓存管理项目介绍:
通过在springmvc配置文件中配置oracle数据库连接信息实现JdbcTemplate连接数据库;

在dao和service层中实现查询用户信息方法;

添加Ehcache配置文件ehcache.xml,并在service.Impl中的类通过注释实现缓存管理(如: @Cacheable(value="myCache",key="'findByAccounterName'+#accountnumber"));

配置log日志管理,点击main.jsp中的链接,
1.第一次点击"ld信息"链接时,访问数据库日志打印为:@author lyx:-2015-08-31 10:36:51,681 [INFO] -[com.service.impl.UserServiceImpl] --------数据库中查到此用户号[liudong]对应的用户名为[liudong]
2.当再点击"ld信息"链接时,不会打印日志,这是因为第二次查询时不会访问数据库,直接从缓存中读取数据,所以不会打印数据库
3.点击"更新"链接后,打印日志为:@author lyx:-2015-08-31 10:37:05,594 [INFO] -[com.service.impl.UserServiceImpl] --------移除缓存中此用户号[liudong]对应的用户名[liudong]的缓存
4.当再点击"ld信息"链接时,打印日志:@author lyx:-2015-08-31 10:37:09,046 [INFO] -[com.service.impl.UserServiceImpl] --------数据库中查到此用户号[liudong]对应的用户名为[liudong]
5.点击"清空"链接时,打印日志为:@author lyx:-2015-08-31 10:37:12,112 [INFO] -[com.service.impl.UserServiceImpl] --------移除缓存中的所有数据!
6.点击"lyx信息"链接后打印日志:@author lyx:-2015-08-31 10:37:14,170 [INFO] -[com.service.impl.UserServiceImpl] --------数据库中查到此用户号[liuyuxin]对应的用户名为[liuyuxin]
7.点击"ld信息"链接,打印日志为:@author lyx:-2015-08-31 10:37:16,246 [INFO] -[com.service.impl.UserServiceImpl] --------数据库中查到此用户号[liudong]对应的用户名为[liudong]

Ehcache所需要的jar包:

ehcache-core-2.4.5.jar
ehcache-spring-annotations-1.2.0.jar

log日志需要的jar包:

slf4j-api-1.7.6.jar
slf4j-log4j12-1.7.6.jar

日志详细配置地址:http://blog.csdn.net/u013147600/article/details/47812811

ehcache.xml配置文件

[java] view plain copy
  1. <!-- 1)最好在ehcache.xml中声明不进行updateCheck -->    
  2. <!-- 2)为了配合BigMemory和Size Limit,原来的属性最好改名 -->    
  3. <!--   maxElementsInMemory->maxEntriesLocalHeap -->    
  4. <!--   maxElementsOnDisk->maxEntriesLocalDisk -->    
  5. <!--  
  6. name:Cache的唯一标识  
  7. maxElementsInMemory:内存中最大缓存对象数  
  8. maxElementsOnDisk:磁盘中最大缓存对象数,若是0表示无穷大  
  9. eternal:Element是否永久有效,一但设置了,timeout将不起作用  
  10. overflowToDisk:配置此属性,当内存中Element数量达到maxElementsInMemory时,Ehcache将会Element写到磁盘中  
  11. timeToIdleSeconds:设置Element在失效前的允许闲置时间。仅当element不是永久有效时使用,可选属性,默认值是0,也就是可闲置时间无穷大  
  12. timeToLiveSeconds:设置Element在失效前允许存活时间。最大时间介于创建时间和失效时间之间。仅当element不是永久有效时使用,默认是0.,也就是element存活时间无穷大  
  13. diskPersistent:是否缓存虚拟机重启期数据  
  14. diskExpiryThreadIntervalSeconds:磁盘失效线程运行时间间隔,默认是120秒  
  15. diskSpoolBufferSizeMB:这个参数设置DiskStore(磁盘缓存)的缓存区大小。默认是30MB。每个Cache都应该有自己的一个缓冲区  
  16. memoryStoreEvictionPolicy:当达到maxElementsInMemory限制时,Ehcache将会根据指定的策略去清理内存。默认策略是LRU(最近最少使用)。你可以设置为FIFO(先进先出)或是LFU(较少使用)  
  17.  -->  
  18.   
  19. <ehcache  name="lyxCache">    
  20.      
  21.     <defaultCache    
  22.            maxElementsInMemory="1000"    
  23.            eternal="false"    
  24.            timeToIdleSeconds="120"    
  25.            timeToLiveSeconds="120"    
  26.            overflowToDisk="false"/>    
  27.   
  28.     <cache name="myCache"    
  29.            maxElementsOnDisk="20000"    
  30.            maxElementsInMemory="2000"    
  31.            eternal="true"    
  32.            overflowToDisk="true"    
  33.            diskPersistent="true"/>    
  34. </ehcache>   

springmvc-servlet.xml (springmvc的配置文件)

[java] view plain copy
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <beans xmlns="http://www.springframework.org/schema/beans"    
  3.   xmlns:context="http://www.springframework.org/schema/context"    
  4.  xmlns:p="http://www.springframework.org/schema/p"    
  5.  xmlns:mvc="http://www.springframework.org/schema/mvc"    
  6.  xmlns:cache="http://www.springframework.org/schema/cache"  
  7.  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    
  8.  xsi:schemaLocation="http://www.springframework.org/schema/beans    
  9.       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd    
  10.       http://www.springframework.org/schema/context    
  11.       http://www.springframework.org/schema/context/spring-context.xsd    
  12.       http://www.springframework.org/schema/mvc    
  13.       http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd  
  14.        http://www.springframework.org/schema/cache    
  15.       http://www.springframework.org/schema/cache/spring-cache-3.2.xsd ">  
  16.       <!--  default-autowire="byName" default-lazy-init="true" -->  
  17.   <!-- springMVC比较详细注解 -->  
  18.     
  19.       
  20.   <!-- 基本配置  -begin-->  
  21.     
  22.       <!-- 自动注入 -->  
  23.       <context:annotation-config></context:annotation-config>  
  24.       <!-- 自动扫描包  组件扫描-->  
  25.       <context:component-scan base-package="com"></context:component-scan>  
  26.         
  27.       <!-- 注释驱动 -->  
  28.      <mvc:annotation-driven/>   
  29.         
  30.       <!-- 配置不用DispatcherServlet 拦截的路径 -->  
  31.       <mvc:resources location="/res/" mapping="/res/**"/>   
  32.       <!-- 默认分发处理器不会拦截静态资源 -->  
  33.      <!--  <mvc:default-servlet-handler/> -->  
  34.         
  35.         
  36.       <!-- 默认地址栏访问跳转到首页 -->  
  37.    <!--   <mvc:view-controller path="/" view-name="forward:/index"/>  -->  
  38.       <!-- 也可以利用<mvc:view-controller/>配置错误页面的跳转 -->  
  39.         
  40.         
  41.        <!-- 避免IE执行AJAX时,返回JSON出现下载文件 -->  
  42.     <bean id="mappingJacksonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">  
  43.         <property name="supportedMediaTypes">  
  44.             <list>  
  45.                 <value>text/html;charset=UTF-8</value>  
  46.             </list>  
  47.         </property>  
  48.     </bean>  
  49.    
  50.     <!-- 启动Spring MVC的注解功能,完成请求和注解POJO的映射 -->  
  51.     <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">  
  52.         <property name="messageConverters">  
  53.             <list>  
  54.                 <ref bean="mappingJacksonHttpMessageConverter" /><!-- json转换器 -->  
  55.             </list>  
  56.         </property>  
  57.     </bean>  
  58.         
  59.         
  60.         
  61.       <!-- 采用SpringMVC自带的JSON转换工具,支持@ResponseBody注解 -->  
  62.    <!--   <bean id="annotationMethodHandlerAdapter" class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">  
  63.         <property name="messageConverters">  
  64.             <list>  
  65.                 解析JSON数据,将json转换成java对象,避免IE执行AJAX时,返回JSON出现下载文件  
  66.                 <bean id="mappingJacksonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">  
  67.                     <property name="supportedMediaTypes">  
  68.                         <list>  
  69.                             <value>text/html;charset=UTF-8</value>  
  70.                         </list>  
  71.                     </property>  
  72.                 </bean>  
  73.                       
  74.             </list>  
  75.         </property>  
  76.       </bean>  -->  
  77.          
  78.          
  79.   
  80.         
  81.         
  82.       <!-- 视图解析器 -->  
  83.        <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" >  
  84.          <property name="prefix" value="/"></property>  
  85.          <property name="suffix" value=".jsp"></property>  
  86.            
  87.           <property name="viewClass"    
  88.             value="org.springframework.web.servlet.view.JstlView"></property>    
  89.       </bean>   
  90.         
  91.       
  92.     <!-- 基本配置  -end-->  
  93.       
  94.       
  95.     <!-- 配置Ehcache缓存 -->  
  96.     <!-- 启动缓存注解功能 -->  
  97.     <cache:annotation-driven cache-manager="cacheManager"/>  
  98.       
  99.     <!-- Spring自己的基于java.util.concurrent.ConcurrentHashMap实现的缓存管理器(该功能是从Spring3.1开始提供的) -->  
  100.     <!-- <bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">  
  101.         <property name="caches">  
  102.             <set>  
  103.                 <bean name="myCache" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"></bean>  
  104.             </set>  
  105.         </property>  
  106.     </bean> -->  
  107.       
  108.     <!-- 若只想使用Spring自身提供的缓存器,则注释掉下面的两个关于Ehcache配置的bean,并启用上面的SimpleCacheManager即可 -->    
  109.     <!-- Spring提供的基于的Ehcache实现的缓存管理器 -->   
  110.     
  111.     <bean id="ehCacheManagerFactoryBean" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">    
  112.         <property name="configLocation" value="classpath:ehcache.xml"/>    
  113.     </bean>    
  114.      <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">  
  115.         <property name="cacheManager" ref="ehCacheManagerFactoryBean"></property>  
  116.     </bean>    
  117.       
  118.       
  119.       
  120.       
  121.     <!-- 功能配置 -begin-->  
  122.           
  123.         <!-- 配置springJDBC Template -->  
  124.         <!-- 引入项目配置文件  方法一-->  
  125.         <!-- <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">  
  126.             <property name="locations">  
  127.                 <list>  
  128.                     <value>classpath:dbconfig.properties</value>  
  129.                 </list>  
  130.             </property>  
  131.         </bean>  -->  
  132.         <!-- 引入项目配置文件 方法二-->  
  133.     <!--     <context:property-placeholder location="classpath:dbconfig.properties"/>  
  134.           
  135.           
  136.          <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">  
  137.                 <property name="url" value="${url}"></property>  
  138.                 <property name="driverClassName"  value="${driverClassName}"></property>  
  139.                 <property name="username" value="${username}"></property>  
  140.                 <property name="password" value="${password}"></property>  
  141.             </bean>  
  142.                 jdbcTemplate  
  143.             <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" >  
  144.                 <property name="dataSource" ref="dataSource">  
  145.                       
  146.                 </property>  
  147.             </bean>  -->  
  148.           
  149.         <!-- datasource 配置数据库 -->  
  150.             <!-- datasource -->  
  151.             <!--  destroy-method="close"的作用是当数据库连接不使用的时候,就把该连接重新放到数据池中,方便下次使用调用.-->  
  152.              <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">  
  153.                 <property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"></property>  
  154.                 <property name="driverClassName"  value="oracle.jdbc.driver.OracleDriver"></property>  
  155.                 <property name="username" value="lyx"></property>  
  156.                 <property name="password" value="lyx"></property>  
  157.             </bean>  
  158.                 <!-- jdbcTemplate -->  
  159.             <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" >  
  160.                 <property name="dataSource" ref="dataSource">  
  161.                       
  162.                 </property>  
  163.             </bean>   
  164.       
  165.        
  166.        
  167.        
  168.     
  169.       
  170.          <!-- 文件上传配置 -->  
  171.       <!--    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">  
  172.             <property name="defaultEncoding" value="UTF-8"></property> 默认编码  
  173.             <property name="maxUploadSize" value="10000000"></property> 上传文件大小  
  174.          </bean> -->  
  175.            
  176.            
  177.           <!-- 拦截器 -->  
  178.           <!--  
  179.         <mvc:interceptors>  
  180.              <mvc:interceptor>   
  181.                 拦截全部地址  
  182.                 <mvc:mapping path="/**"/>    
  183.                 登录拦截类  
  184.                 <bean id="loginInterceptor" class="com.sgcc.uds.fs.config.web.interceptor.LoginInterceptor">  
  185.                 </bean>  
  186.              </mvc:interceptor>     
  187.         </mvc:interceptors>  
  188.         -->  
  189.           
  190.         <!-- 异常 -->  
  191.         <!--    
  192.           <bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">    
  193.           <property name="exceptionMappings">    
  194.             <props>    
  195.                 登录失败异常类  
  196.               <prop key="com.sgcc.uds.fs.config.web.interceptor.UnLoginException">redirect:/toLogin</prop>    
  197.             </props>    
  198.           </property>    
  199.         </bean>      
  200.         -->  
  201.        
  202.    <!-- 功能配置 -end-->  
  203.        
  204. </beans>  

UserService.java 

[java] view plain copy
  1. package com.service;  
  2.   
  3. import java.util.List;  
  4. import java.util.Map;  
  5. import com.entity.MemberUser;  
  6.   
  7. /** 
  8.  * @author lyx 
  9.  * 
  10.  * 2015-8-19上午8:51:59 
  11.  * 
  12.  *service.UserService 
  13.  *  TODO 
  14.  */  
  15. public interface UserService {  
  16.   
  17.  public List<Map<String,Object>> queryAllInfo(int currentPage,int limitPage);  
  18.    
  19.  public int totalCount();  
  20.    
  21.  public List<Map<String, Object>>  findByAccounterName(String accountnumber);  
  22.    
  23.  public void update(String accountnumber);  
  24.    
  25.  public void removeAll();  
  26. }  

UserServiceImpl.java

[java] view plain copy
  1. package com.service.impl;  
  2.   
  3. import java.util.List;  
  4. import java.util.Map;  
  5.   
  6. import org.slf4j.Logger;  
  7. import org.slf4j.LoggerFactory;  
  8. import org.springframework.beans.factory.annotation.Autowired;  
  9. import org.springframework.cache.annotation.CacheEvict;  
  10. import org.springframework.cache.annotation.Cacheable;  
  11. import org.springframework.stereotype.Service;  
  12.   
  13. import com.dao.UserDao;  
  14. import com.dao.Impl.UserDaoImpl;  
  15. import com.entity.MemberUser;  
  16.   
  17. import com.service.UserService;  
  18.   
  19. /** 
  20.  * @author lyx 
  21.  * 
  22.  * 2015-8-19上午8:52:16 
  23.  * 
  24.  *service.impl.UserServiceImpl 
  25.  *  TODO 
  26.  */  
  27.   
  28. @Service("UserService")  
  29. public class UserServiceImpl  implements UserService{  
  30.    
  31.  @Autowired  
  32.  private UserDao dao;  
  33.    
  34.  private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);  
  35.    
  36.  public List<Map<String, Object>> queryAllInfo(int currentPage,int limitPage) {  
  37.   // TODO Auto-generated method stub  
  38.    
  39.   return dao.queryAllInfo( currentPage, limitPage);  
  40.  }  
  41.   
  42.  public int totalCount() {  
  43.   // TODO Auto-generated method stub  
  44.   return dao.totalCount();  
  45.  }  
  46.    
  47.   //将查询到的数据缓存到myCache中,并使用方法名称加上参数中的userNo作为缓存的key    
  48.     //通常更新操作只需刷新缓存中的某个值,所以为了准确的清除特定的缓存,故定义了这个唯一的key,从而不会影响其它缓存值    
  49.  @Cacheable(value="myCache",key="'findByAccounterName'+#accountnumber")  
  50.  public List<Map<String, Object>> findByAccounterName(String accountnumber) {  
  51.   // TODO Auto-generated method stub/*dao.findByAccounterName(accountnumber).get(0).get("ACCOUNTNUMBER") */  
  52.   System.out.println("数据库中查到此用户号[" + accountnumber + "]对应的用户名为[" +accountnumber + "]");  
  53.    
  54.   logger.info("-------数据库中查到此用户号[" + accountnumber + "]对应的用户名为[" +accountnumber + "]");  
  55.   return dao.findByAccounterName(accountnumber);  
  56.  }  
  57.   
  58.  @CacheEvict(value="myCache",key="'findByAccounterName'+#accountnumber")  
  59.  public void update(String accountnumber)  
  60.  {// dao.findByAccounterName(accountnumber).get(0).get("ACCOUNTNUMBER")  
  61.   System.out.println("移除缓存中此用户号[" + accountnumber + "]对应的用户名[" + accountnumber+ "]的缓存");  
  62.   logger.info("-------移除缓存中此用户号[" + accountnumber + "]对应的用户名[" + accountnumber+ "]的缓存");  
  63.  }  
  64.   
  65.  //allEntries为true表示清除value中的全部缓存,默认为false    
  66.  @CacheEvict(value="myCache",allEntries=true)  
  67.  public void removeAll()  
  68.  {  
  69.   System.out.println("移除缓存中的所有数据!");  
  70.   logger.info("-------移除缓存中的所有数据!");  
  71.  }  
  72. }  

UserController.java中方法:

[java] view plain copy
  1. @Controller  
  2. @RequestMapping("/user")  
  3. public class UserController {  
  4.   
  5.  @RequestMapping("/queryUserInfoByUsername")  
  6.  public String queryUserInfoByUsername(HttpServletRequest request)  
  7.  {  
  8.   String username = request.getParameter("username");  
  9.    
  10.   List<Map<String, Object>> userlist = new ArrayList<Map<String,Object>>();  
  11.   MemberUser user =new MemberUser();  
  12.    
  13.   if(username!=null)  
  14.   {  
  15.    userlist = service.findByAccounterName(username);  
  16.    //user=(MemberUser) userlist.get(0);  
  17.    for (Map<String, Object> map : userlist) {  
  18.     for (String key : map.keySet()) {  
  19.        
  20.      user.setAccountNumber(map.get("ACCOUNTNUMBER").toString());  
  21.      user.setMemberName(map.get("MEMBERNAME").toString());  
  22.      System.out.print(key+":"+map.get(key));  
  23.     }  
  24.    }  
  25.    if(user!=null)  
  26.    {  
  27.     request.setAttribute("memberUser", user);  
  28.      
  29.     return "/myInfo";  
  30.    }  
  31.   }  
  32.    
  33.   return null;  
  34.  }  
  35.    
  36.    
  37.  @RequestMapping(value="/update",method=RequestMethod.GET)  
  38.  public String update(HttpServletRequest request)  
  39.  {  
  40.   String username = request.getParameter("username");  
  41.   service.update(username);  
  42.   request.setAttribute("accounterNumber", username);  
  43.    
  44.   return "/update";  
  45.  }  
  46.    
  47.  @RequestMapping(value="/removeAll",method=RequestMethod.GET)  
  48.  public String removeAll()  
  49.  {  
  50.   service.removeAll();  
  51.   return "/removeAll";  
  52.  }  
  53. }  

main.jsp

[java] view plain copy
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>  
  2. <%  
  3. String path = request.getContextPath();  
  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
  5. request.setAttribute("home", path);  
  6. %>  
  7.   
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
  9. <html>  
  10.   <head>  
  11.     <base href="<%=basePath%>">  
  12.      
  13.     <title>main</title>  
  14.   
  15.  <link rel="stylesheet" href="${home}/res/css/bootstrap.min.css" type="text/css"></link>  
  16.  <link rel="stylesheet" href="${home}/res/css/allStyle.css" type="text/css"></link>  
  17.    
  18.  <style type="text/css">  
  19.    
  20.  .userTable{  
  21.    
  22.   font-size: 20px;  
  23.  }  
  24.  </style>  
  25.    
  26.  <script type="text/javascript">  
  27.   var home ="${home}";  
  28.  </script>  
  29.   </head>  
  30.    
  31.   <body>  
  32.    
  33.   <div>  
  34.    <h2 class="sub-header">管理列表</h2>     
  35.     <ul>  
  36.      <li> <a href="${home}/user/queryUserInfoByUsername?username=liuyuxin" target="_blank">lyx信息</a></li>  
  37.      <li> <a href="${home}/user/queryUserInfoByUsername?username=liudong" target="_blank">ld信息</a></li>  
  38.      <li> <a href="${home}/user/update?username=liudong" target="_blank">更新</a></li>  
  39.      <li> <a href="${home}/user/removeAll" target="_blank">清空</a></li>  
  40.      <li> <a href="${home}/index.jsp" target="_blank">全部信息</a></li>  
  41.     </ul>  
  42.   </div>  
  43.     
  44.     <script type="text/javascript" src="${home}/res/js/jquery-1.11.3.min.js"></script>  
  45.   
  46.   </body>  
  47. </html>  

图片:


console控制台日志:

[java] view plain copy
  1. @author lyxx:-2015-08-31 10:36:51,681 [INFO] -[com.service.impl.UserServiceImpl] --------数据库中查到此用户号[liudong]对应的用户名为[liudong]  
  2.   
  3. @author lyxx:-2015-08-31 10:37:05,594 [INFO] -[com.service.impl.UserServiceImpl] --------移除缓存中此用户号[liudong]对应的用户名[liudong]的缓存  
  4.   
  5. @author lyxx:-2015-08-31 10:37:09,046 [INFO] -[com.service.impl.UserServiceImpl] --------数据库中查到此用户号[liudong]对应的用户名为[liudong]  
  6.   
  7. @author lyxx:-2015-08-31 10:37:12,112 [INFO] -[com.service.impl.UserServiceImpl] --------移除缓存中的所有数据!  
  8. 数据库中查到此用户号[liuyuxin]对应的用户名为[liuyuxin]  
  9. @author lyxx:-2015-08-31 10:37:14,170 [INFO] -[com.service.impl.UserServiceImpl] --------数据库中查到此用户号[liuyuxin]对应的用户名为[liuyuxin]  
  10.   
  11. @author lyxx:-2015-08-31 10:37:16,246 [INFO] -[com.service.impl.UserServiceImpl] --------数据库中查到此用户号[liudong]对应的用户名为[liudong]  

文件打印日志:

[java] view plain copy
  1. 2015-08-31 10:36:45  [ http-apr-8080-exec-8:26719 ] - [ INFO ]  Loaded JDBC driver: oracle.jdbc.driver.OracleDriver  
  2. 2015-08-31 10:36:51  [ http-apr-8080-exec-3:33050 ] - [ INFO ]  -------数据库中查到此用户号[liudong]对应的用户名为[liudong]  
  3. 2015-08-31 10:37:05  [ http-apr-8080-exec-8:46963 ] - [ INFO ]  -------移除缓存中此用户号[liudong]对应的用户名[liudong]的缓存   
  4. 2015-08-31 10:37:09  [ http-apr-8080-exec-3:50415 ] - [ INFO ]  -------数据库中查到此用户号[liudong]对应的用户名为[liudong]  
  5. 2015-08-31 10:37:12  [ http-apr-8080-exec-4:53481 ] - [ INFO ]  -------移除缓存中的所有数据!  
  6. 2015-08-31 10:37:14  [ http-apr-8080-exec-7:55539 ] - [ INFO ]  -------数据库中查到此用户号[liuyuxin]对应的用户名为[liuyuxin]  
  7. 2015-08-31 10:37:16  [ http-apr-8080-exec-8:57615 ] - [ INFO ]  -------数据库中查到此用户号[liudong]对应的用户名为[liudong]  

参考网址:http://blog.csdn.net/jadyer/article/details/12257865

原创粉丝点击