会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
菜鸟需勤奋
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
25
26
27
28
29
30
31
32
33
···
47
下一页
2022年9月27日
dubbo泛化调用
摘要: <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <g
阅读全文
posted @ 2022-09-27 22:25 iTao0128
阅读(158)
评论(0)
推荐(0)
2022年9月25日
自定义参数绑定
摘要: 页面提交的请求数据(get,post)都可以和对象属性进行绑定 @PostMapping("/saveUser") public Person saveUser(Person person){ return person; }
阅读全文
posted @ 2022-09-25 22:28 iTao0128
阅读(21)
评论(0)
推荐(0)
向request域中添加数据
摘要: Map<String,Object> map、Model model、HttpServletRequest request都是可以给request域中放数据,再用request.getAttribute取数据 package com.java.boot.controller; import org.
阅读全文
posted @ 2022-09-25 21:11 iTao0128
阅读(178)
评论(0)
推荐(0)
常用参数注解
摘要: 路径变量@PathVariable ①获取指定路径变量: @GetMapping("/car/{id}/owner/{userName}") public Map<String,Object> getCar(@PathVariable("id") int id, @PathVariable("use
阅读全文
posted @ 2022-09-25 14:02 iTao0128
阅读(136)
评论(0)
推荐(0)
2022年9月24日
欢迎页与favicon
摘要: 欢迎页 将index.html放入默认的静态资源路径下,会默认访问。 访问路径:http://localhost:8080/ 如下设置了项目的根访问路径,则欢迎页访问需使用:http://localhost:8080/my/ spring:# mvc:# static-path-pattern: /
阅读全文
posted @ 2022-09-24 22:50 iTao0128
阅读(57)
评论(0)
推荐(0)
2022年9月21日
静态资源访问
摘要: 默认静态资源目录 类路径下:/static、/public、/resources、/META-INF/resources 以下路径下静态资源可直接访问,如http://localhost:8080/hu4.jpeg 原理:静态映射/** 请求进来,先看controller能不能处理,不能处理的所有请
阅读全文
posted @ 2022-09-21 22:46 iTao0128
阅读(129)
评论(0)
推荐(0)
2022年9月20日
自定义类绑定配置文件-自动提示
摘要: package com.java.boot.config; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.boot.c
阅读全文
posted @ 2022-09-20 21:55 iTao0128
阅读(38)
评论(0)
推荐(0)
2022年9月19日
@ConfigurationProperties配置绑定
摘要: import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; @Component//组件加入容器中 @Conf
阅读全文
posted @ 2022-09-19 22:41 iTao0128
阅读(32)
评论(0)
推荐(0)
2022年9月18日
@Conditional
摘要: 条件装配:满足Conditional指定的条件,则进行组件注入 @Configuration//告诉springboot这是一个配置类 public class MyConfig { @Bean("tom") public Stu stu01(){ return new Stu("汤姆"); } @
阅读全文
posted @ 2022-09-18 22:54 iTao0128
阅读(40)
评论(0)
推荐(0)
@Configuration容器中注册组件
摘要: import boot.bean.Stu; import boot.bean.User; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configu
阅读全文
posted @ 2022-09-18 17:16 iTao0128
阅读(33)
评论(0)
推荐(0)
上一页
1
···
25
26
27
28
29
30
31
32
33
···
47
下一页
公告