随笔分类 - springboot
摘要:时间参数参考: https://www.cnblogs.com/Rain1203/p/11699420.html 1、程序开启入口 @SpringBootApplication @EnableScheduling public class Application { public static vo
阅读全文
摘要:官网 https://docs.spring.io/spring-security/site/docs/5.2.1.RELEASE/reference/htmlsingle/#saml2 一、安全? 1、非功能性需求 2、设计之初,考虑安全 二、功能 认证、授权 三、使用 1、导入thymeleaf
阅读全文
摘要:@GetMapping({"/index", "/yy"}) private String index(){ return "index"; } 访问 /index 和 访问 /yy 的效果一致
阅读全文
摘要:一、前提条件:连接数据库 二、步骤 1、导包 <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.3</ve
阅读全文
摘要:过程 1、导入包 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.12</version> </dependency> 2、配置application.yml文件 spri
阅读全文
摘要:前提:配置数据库连接(见前面) 一、步骤 1、导包 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> 2、操
阅读全文
摘要:一、mysql8 以上 步骤 1、导包 <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.11</version> </dependency> 注意:根据数
阅读全文
摘要:i18n 在resiurce下创建i18n文件夹 修改yaml文件 spring: messages: basename: i18n.login 4、修改模板 thymeleaft语法 #{login.tip} 国际化 添加语言配置
阅读全文
摘要:语法 // 记录器 Logger logger = LoggerFactory.getLogger(getClass()); @Test void contextLoads() { // springboot 默认开启的级别是 info logger.trace("trace"); logger.d
阅读全文
摘要:一、前提条件 1、导入thymeleaf <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf-spring5</artifactId> </dependency> 2、html templates文件夹中创建html
阅读全文
摘要:本以为此功能已经舍弃,万万没想到需要导入包 参考下面的博客(日后有空验证) https://www.cnblogs.com/huanchupkblog/p/12915268.html
阅读全文
摘要:一、前提条件 1、开启热加载 2、配置mybatis-plus 见 mybatis的博客 二、路由 1、导包 <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.60</
阅读全文
摘要:创建项目的时候,开启热部署 参考: https://www.cnblogs.com/scorpio-xinghen/p/11660203.html 1、maven 添加 <dependency> <groupId>org.springframework.boot</groupId> <artifac
阅读全文
摘要:参考文档 https://www.cnblogs.com/msi-chen/p/10974009.html#_label1_0 一、准备工作 1、导包 或 创建项目时勾选 <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymel
阅读全文
摘要:看源码 WebMvcAutoConfiguration.java 优先级:访问:localhost:8080/ resources > static >public 关闭模板缓存 spring: thymeleaf: cache: false https://www.cnblogs.com/wt70
阅读全文
摘要:一、优先级 1、文件路径 file:./config/ file:./config/*/ file:./ classpath:/config/ classpath:/ 2、优先级 二、配置不同的开发环境 application.yml spring: profiles: active: online
阅读全文
摘要:官方文档 https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/html/spring-boot-features.html#boot-features-external-config-yaml 一、基础 1、注意事项 key
阅读全文