# SpringBoot2核心技术与响应式编程 **Repository Path**: jack-net/springboot2 ## Basic Information - **Project Name**: SpringBoot2核心技术与响应式编程 - **Description**: SpringBoot2核心技术与响应式编程 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1199 - **Created**: 2023-01-06 - **Last Updated**: 2023-11-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## SpringBoot2核心技术与响应式编程 ### 官网 - 各版本文档目录 [Spring Boot官方文档](https://docs.spring.io/spring-boot/docs/) - 当前版本2.4.0 [Spring Boot Reference Documentation](https://docs.spring.io/spring-boot/docs/2.4.0/reference/html/) ### 介绍 SpringBoot2核心技术与响应式编程 ### 软件架构 软件架构说明 ● 文档地址: https://www.yuque.com/atguigu/springboot ○ 文档不支持旧版本IE、Edge浏览器,请使用chrome或者firefox ● 视频地址: http://www.gulixueyuan.com/ https://www.bilibili.com/video/BV19K4y1L7MT?p=1 ### 代码说明 #### boot-01-helloworld-2 :配置文件 ##### 配置文件 ~~~yaml person: # 单引号会将 \n作为字符串输出 双引号会将\n 作为换行输出 # 双引号不会转义,单引号会转义 boss: true birth: 2019/12/9 age: 18 # interests: [篮球,足球] interests: - 篮球 - 足球 - 18 animal: [阿猫,阿狗] # score: # english: 80 # math: 90 score: {english:80,math:90} salarys: - 9999.98 - 9999.99 pet: name: 阿狗 weight: 99.99 allPets: sick: - {name: 阿狗,weight: 99.99} - name: 阿猫 weight: 88.88 - name: 阿虫 weight: 77.77 health: - {name: 阿花,weight: 199.99} - {name: 阿明,weight: 199.99} user-name: zhangsan ~~~ ##### Java Bean ```java @ConfigurationProperties(prefix = "person") @Component @ToString @Data public class Person { private String userName; private Boolean boss; private Date birth; private Integer age; private Pet pet; private String[] interests; private List animal; private Map score; private Set salarys; private Map> allPets; } @ToString @Data public class Pet { private String name; private Double weight; } ``` #### boot-05-web-01 :Web 开发 - 欢迎页设置 - favicon.ico 网站图标 - 开启mvc RESTFull 风格 ```yaml spring: mvc: hiddenmethod: filter: enabled: true # 开启后,可以让SpringMvc 使用 RESTFull 风格 ``` - 自定义 `_m` 的方法:WebConfig ```java @Configuration(proxyBeanMethods = false) public class WebConfig /*implements WebMvcConfigurer*/ { @Bean public HiddenHttpMethodFilter hiddenHttpMethodFilter(){ HiddenHttpMethodFilter methodFilter = new HiddenHttpMethodFilter(); methodFilter.setMethodParam("_m"); return methodFilter; } ``` - xxx - xxx #### boot-05-adminserver actuator 指标监控 监控服务 引入依赖 ```xml de.codecentric spring-boot-admin-starter-server 2.3.1 ``` #### boot-05-web-admin : 后台管理开发 ###### thymeleaf 模板引擎 - 官网: [Tutorial: Using Thymeleaf](https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html) - 导入 命名 空间 ```html ``` - 标签使用 ``` // th 标签