摘要: 1注解: @PathVariable、 restful风格的参数 @RequestHeader、 请求头中的参数 @ModelAttribute、 ... @RequestParam、 获取请求参数 @MatrixVariable、 解析矩阵变量 @CookieValue、 解析Cookie @Re 阅读全文
posted @ 2022-09-04 05:10 咖喱给给啊 阅读(21) 评论(0) 推荐(0)
摘要: 1、静态资源目录 只要静态资源放在类路径下: called /static (or /public or /resources or /META-INF/resources 访问 : 当前项目根路径/ + 静态资源名 原理: 静态映射/**。 请求进来,先去找Controller看能不能处理。不能处 阅读全文
posted @ 2022-09-04 04:00 咖喱给给啊 阅读(35) 评论(0) 推荐(0)
摘要: Spring Boot provides auto-configuration for Spring MVC that works well with most applications.(大多场景我们都无需自定义配置) The auto-configuration adds the followi 阅读全文
posted @ 2022-09-04 03:36 咖喱给给啊 阅读(25) 评论(0) 推荐(0)
摘要: YAML 是 "YAML Ain't Markup Language"(YAML 不是一种标记语言)的递归缩写。在开发的这种语言时,YAML 的意思其实是:"Yet Another Markup Language"(仍是一种标记语言)。非常适合用来做以数据为中心的配置文件 基本语法 key: val 阅读全文
posted @ 2022-09-04 03:31 咖喱给给啊 阅读(35) 评论(0) 推荐(0)
摘要: 选择我们需要的开发场景 勾选场景后 就自动导入了依赖 自动创建项目结构 自动编写好主配置类 阅读全文
posted @ 2022-09-04 01:10 咖喱给给啊 阅读(28) 评论(0) 推荐(0)
摘要: 热更新 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency> 项目或 阅读全文
posted @ 2022-09-04 01:07 咖喱给给啊 阅读(39) 评论(0) 推荐(0)
摘要: 1.导入依赖 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </dependency> idea中搜索安装lombok插件 简化JavaBean开发 @NoArgsConstruct 阅读全文
posted @ 2022-09-04 01:05 咖喱给给啊 阅读(21) 评论(0) 推荐(0)
摘要: 引入场景依赖 https://docs.spring.io/spring-boot/docs/current/reference/html/using-spring-boot.html#using-boot-starter 查看自动配置了哪些(选做) 自己分析,引入场景对应的自动配置一般都生效了 配 阅读全文
posted @ 2022-09-04 00:58 咖喱给给啊 阅读(25) 评论(0) 推荐(0)
摘要: 简单分析一下场景中的自动配置的流程 就拿springboot-autoconfiguration中的web场景来简单分析 进入web的servlet中的DispatcherServletAutoConfiguration 第一个是优先级不影响自动配置 第二个是是否单例,前端控制器不是单例的,因为是做 阅读全文
posted @ 2022-09-04 00:42 咖喱给给啊 阅读(134) 评论(0) 推荐(0)