摘要:
SpringBoot整合Shiro 1.shiro是什么? Shiro是Apache下的一个开源项目。shiro属于轻量级框架,相对于SpringSecurity简单的多,也没有SpringSecurity那么复杂。 2.主要功能 shiro主要有三大功能模块: Subject:主体,一般指用户。 阅读全文
摘要:
SpringBoot整合SpringSecurity 1. 认识SpringSecurity Spring Security 是针对Spring项目的安全框架,也是Spring Boot底层安全模块默认的技术选型,他可以实现强大的Web安全控制,对于安全控制,我们仅需要引入spring-boot-s 阅读全文
摘要:
自定义starter starter: 1、这个场景需要使用到的依赖是什么? 2、如何编写自动配置 @Configuration //指定这个类是一个配置类 @ConditionalOnXXX //在指定条件成立的情况下自动配置类生效 @AutoConfigureAfter //指定自动配置 阅读全文
摘要:
SpringBoot与数据访问 1、JDBC <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <depen 阅读全文
摘要:
配置嵌入式Servlet容器 SpringBoot默认使用Tomcat作为嵌入式的Servlet容器; 问题? 1)、如何定制和修改Servlet容器的相关配置; 1、修改和server有关的配置(ServerProperties【也是EmbeddedServletContainerCustomiz 阅读全文
摘要:
错误处理机制 1)、SpringBoot默认的错误处理机制 默认效果: 1)、浏览器,返回一个默认的错误页面 浏览器发送请求的请求头: 2)、如果是其他客户端,默认响应一个json数据 原理: 可以参照ErrorMvcAutoConfiguration;错误处理的自动配置; 给容器中 阅读全文
摘要:
SpringMVC自动配置 https://docs.spring.io/spring-boot/docs/1.5.10.RELEASE/reference/htmlsingle/#boot-features-developing-web-applications 1. Spring MVC aut 阅读全文
摘要:
模板引擎 JSP、Velocity、Freemarker、Thymeleaf SpringBoot推荐的Thymeleaf; 语法更简单,功能更强大; 1、引入thymeleaf; <dependency> <groupId>org.springframework.boot</groupId> <a 阅读全文
摘要:
SpringBoot对静态资源的映射规则 @ConfigurationProperties(prefix = "spring.resources", ignoreUnknownFields = false) public class ResourceProperties implements Res 阅读全文