首先当然是项目中需要增加shiro的架包依赖: <!-- shiro --> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-core</artifactId> <version>${shiro.version}</version> <exclusions> <exclusion> <artifa…
1.shiro配置文件增加sessionManager管理 <!-- 6.shiro结合Session会话管理器 start --> <bean id="sessionManager" class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager"> <!-- session的失效时长,单位毫秒 1小时: 3600000, itzixi站点设置以 6小时 为主:2160…
1.加入依赖 <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-ehcache</artifactId> <version>${shiro.version}</version> <exclusions> <exclusion> <artifactId>slf4j-api</artifactId>…
==他的博客应该不错,没有细看 Spring Boot学习记录(二)--thymeleaf模板 - CSDN博客 http://blog.csdn.net/u012706811/article/details/52185345 --关于springboot的 springboot - 蜕变之路 - CSDN博客http://blog.csdn.net/u012706811/article/category/6357760 自从来公司后都没用过jsp当界面渲染了,因为前后端分离不是很好,反而模板引…
Spring Boot版本: 2.0.0.RELEASE 这里需要引入依赖 spring-boot-starter-web 这里有可能有个人的误解,请抱着怀疑态度看. 建议: 感觉自己也会被绕晕,所以有兴趣的使用IDE工具看下源码 1.Tomcat在什么时候被初始化了? 在ServletWebServerApplicationContext中有段代码,如下: org.springframework.boot.web.servlet.context.ServletWebServerApplicat…
自从来公司后都没用过jsp当界面渲染了,因为前后端分离不是很好,反而模板引擎用的比较多,thymeleaf最大的优势后缀为html,就是只需要浏览器就可以展现页面了,还有就是thymeleaf可以很好的和spring集成.下面开始学习. 1.引入依赖 maven中直接引入 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thyme…
1.集成Spring 参考文献: 新建web工程: ehcache-core来自Hibernate wen.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi…
前言:本系列文章非本人原创,转自:http://tengj.top/2017/04/24/springboot0/ 正文 首先声明,Spring Boot不是一门新技术.从本质上来说,Spring Boot就是Spring,它做了那些没有它你也需要去做的Spring Bean配置.它使用“习惯优于配置”(项目中存在大量的配置,此外还内置了一个习惯性的配置,让你无需手动进行配置)的理念让你的项目快速运行起来.使用Spring Boot很容易创建一个独立运行(运行jar,内嵌Servlet容器).准…
1.在applicationContext-redis.xml配置文件中增加如下: 申明一个cacheManager对象 用来注入到  shiro的   securityManager 属性  cacheManager 中 <!--spring rediscache--> <bean id="cacheManager" class="org.springframework.data.redis.cache.RedisCacheManager" c:…
1. 背景 Spring Boot通过包管理工具引入starter包就可以轻松使用,省去了配置的繁琐工作,这里简要的通过个人的理解说下Spring Boot启动过程中如何去自动加载配置. 本文中使用的Spring Boot版本为2.0.0.RELEASE 这里主要是说自动配置大致调用流程,其他暂不做分析 2. 主要内容 2.1. spring.factories 首先,需要了解一件事,首先得知道有这么一件事,而自动配置这一件事得从META-INF/spring.factories说起.其本质类似…