SSM整合ehcache

1.添加依赖。除SSM所需的包外,还需要添加的包为 mybatis-ehcache.jar、ehcache-spring-annotations.jar;maven坐标如下:



    org.mybatis.caches
    mybatis-ehcache
    1.0.3




    com.googlecode.ehcache-spring-annotations
    ehcache-spring-annotations
    1.2.0

2.echache配置文件,如下:

ehcache.xml



    
    

applicationContext-echache.xml









    
    


3.将echache配置文件加载到spring-mvc.xml中




4.在mybatis mapper.xml中配置,比如SysUserMapper.xml





    
    
    

你可能感兴趣的:(mybatis,spring,ehcache)