随笔分类 -  SpringBoot-第二阶段

摘要:一、初识 引入环境 <!-- 引入监控功能--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> 阅读全文
posted @ 2022-08-15 17:21 Dabo丶 阅读(366) 评论(0) 推荐(0) 编辑
摘要:关联注解:@Profile-指定组件在哪种情况下注册到容器中 配置类中手动修改 简单配置 1.配置类 application.properties -- 主配置类 spring.profiles.active=test application-prod.yaml -- 正式环境配置类 user: n 阅读全文
posted @ 2022-08-15 08:39 Dabo丶 阅读(243) 评论(0) 推荐(0) 编辑
摘要:HandlerInterceptor: 此类中有三个方法 1.preHandle() -- 处理程序执行之前的拦截点。 2.postHandle() -- 成功执行处理程序后的拦截点。 3.afterCompletion() -- 请求处理完成后的回调,即渲染视图后。 如下简单写法 配置类 /** 阅读全文
posted @ 2022-08-11 16:40 Dabo丶 阅读(384) 评论(0) 推荐(0) 编辑
摘要:通过修改请求头的参数来实现返回值重写 配置类 import com.example.studywork1.pojo.User; import org.springframework.http.HttpInputMessage; import org.springframework.http.Http 阅读全文
posted @ 2022-07-26 13:18 Dabo丶 阅读(400) 评论(0) 推荐(0) 编辑
摘要:Spring Boot 请求和请求参数处理解析 源码分析 上面请求和请求参数处理解析中已经解析到 DispatcherServlet - > doDispatch - > mappedHandler = getHandler(processedRequest); 找到请求应该由哪个个Handler处 阅读全文
posted @ 2022-07-15 11:58 Dabo丶 阅读(54) 评论(0) 推荐(0) 编辑
摘要:配置类 @Component public class MyConfig { @Bean public WebMvcConfigurer webMvcConfigurer(){ return new WebMvcConfigurer() { @Override public void addForm 阅读全文
posted @ 2022-07-15 11:56 Dabo丶 阅读(52) 评论(0) 推荐(0) 编辑
摘要:请求映射 1、rest使用与原理 @xxxMapping; Rest风格支持(使用HTTP请求方式动词来表示对资源的操作) 以前:/getUser 获取用户 /deleteUser 删除用户 /editUser 修改用户 /saveUser 保存用户 现在: /user GET-获取用户 DELET 阅读全文
posted @ 2022-07-12 13:36 Dabo丶 阅读(1496) 评论(0) 推荐(0) 编辑
摘要:欢迎页 index 1.在静态资源路径下添加 index.html 直接访问项目地址 在配置yml文件中配置静态资源访问前缀 spring: mvc: static-path-pattern: /res/** 两种访问方式访问后404 静态资源前缀影响欢迎页访问(当前SpringBoot版本spri 阅读全文
posted @ 2022-07-11 12:25 Dabo丶 阅读(1671) 评论(0) 推荐(0) 编辑
摘要:配置文件 1、文件类型 1.1、properties同以前的properties用法 1.2、yaml 1.2.1、简介YAML 是 "YAML Ain't Markup Language"(YAML 不是一种标记语言)的递归缩写。在开发的这种语言时,YAML 的意思其实是:"Yet Another 阅读全文
posted @ 2022-05-30 08:28 Dabo丶 编辑
摘要:1、系统要求 官网查看 1.1、maven设置 <mirrors> <mirror> <id>nexus-aliyun</id> <mirrorOf>central</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/n 阅读全文
posted @ 2022-05-27 09:11 Dabo丶 编辑

点击右上角即可分享
微信分享提示