09 2022 档案

摘要:<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <g 阅读全文
posted @ 2022-09-27 22:25 iTao0128 阅读(141) 评论(0) 推荐(0) 编辑
摘要:页面提交的请求数据(get,post)都可以和对象属性进行绑定 @PostMapping("/saveUser") public Person saveUser(Person person){ return person; } 阅读全文
posted @ 2022-09-25 22:28 iTao0128 阅读(12) 评论(0) 推荐(0) 编辑
摘要: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 阅读(161) 评论(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 阅读(125) 评论(0) 推荐(0) 编辑
摘要:欢迎页 将index.html放入默认的静态资源路径下,会默认访问。 访问路径:http://localhost:8080/ 如下设置了项目的根访问路径,则欢迎页访问需使用:http://localhost:8080/my/ spring:# mvc:# static-path-pattern: / 阅读全文
posted @ 2022-09-24 22:50 iTao0128 阅读(42) 评论(0) 推荐(0) 编辑
摘要:默认静态资源目录 类路径下:/static、/public、/resources、/META-INF/resources 以下路径下静态资源可直接访问,如http://localhost:8080/hu4.jpeg 原理:静态映射/** 请求进来,先看controller能不能处理,不能处理的所有请 阅读全文
posted @ 2022-09-21 22:46 iTao0128 阅读(107) 评论(0) 推荐(0) 编辑
摘要: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 阅读(22) 评论(0) 推荐(0) 编辑
摘要:import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; @Component//组件加入容器中 @Conf 阅读全文
posted @ 2022-09-19 22:41 iTao0128 阅读(27) 评论(0) 推荐(0) 编辑
摘要:条件装配:满足Conditional指定的条件,则进行组件注入 @Configuration//告诉springboot这是一个配置类 public class MyConfig { @Bean("tom") public Stu stu01(){ return new Stu("汤姆"); } @ 阅读全文
posted @ 2022-09-18 22:54 iTao0128 阅读(32) 评论(0) 推荐(0) 编辑
摘要: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 阅读(29) 评论(0) 推荐(0) 编辑
摘要:①创建maven工程 ②pom.xml中添加父工程,集成springboot父项目 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <ve 阅读全文
posted @ 2022-09-14 22:22 iTao0128 阅读(38) 评论(0) 推荐(0) 编辑
摘要:父工程pom.xml <?xml version="1.0" encoding="UTF-8" standalone="no"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001 阅读全文
posted @ 2022-09-12 21:57 iTao0128 阅读(31) 评论(0) 推荐(0) 编辑
摘要:排除依赖 阅读全文
posted @ 2022-09-12 20:19 iTao0128 阅读(13) 评论(0) 推荐(0) 编辑
摘要:1.官网下载maven安装包 https://maven.apache.org/download.cgi https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.zip 2.配置仓库 apache-ma 阅读全文
posted @ 2022-09-12 11:47 iTao0128 阅读(37) 评论(0) 推荐(0) 编辑
摘要:创建的方式 ①通过集合 ②通过数组 ③通过Stream的of() Stream 自己不会存储元素 Stream 不会改变源对象,会返回一个持有结果的新Stream Stream 操作时延迟执行的,等到需要结果的时候才执行 一个中间操作链,对数据源的数据进行处理,一旦执行终止操作,就执行中间操作链,并 阅读全文
posted @ 2022-09-09 22:23 iTao0128 阅读(26) 评论(0) 推荐(0) 编辑
摘要:使用情景 当要传递给lambda体的操作,已经有实现的方法了,可以使用方法引用。 方法引用也是函数式接口的实例 使用格式 (类(对象):: 方法名) ①对象 :: 非静态方法 ②类 :: 静态方法 ③类 :: 非静态方法 使用要求 要求接口中的抽象方法的形参列表和返回值类型与方法引用的方法的形参列表 阅读全文
posted @ 2022-09-08 22:54 iTao0128 阅读(26) 评论(0) 推荐(0) 编辑
摘要:1.Lambda表达式的本质:作为函数式接口的实例 2.格式: ->:Lambda操作符 或 箭头操作符 ->左边:Lambda形参列表(接口中抽象方法的形参列表) ->右边:Lambda体(重写的抽象方法的方法体) 3.Lambda表达式的使用: ->左边:Lambda形参列表的参数类型可以省略: 阅读全文
posted @ 2022-09-08 22:14 iTao0128 阅读(39) 评论(0) 推荐(0) 编辑
摘要:反射的概念 public class Person { private String name; public int age; public Person(String name, int age) { this.name = name; this.age = age; } private Per 阅读全文
posted @ 2022-09-04 22:03 iTao0128 阅读(15) 评论(0) 推荐(0) 编辑
摘要:public class TCPTest { @Test public void client() { Socket socket = null; OutputStream os = null; try { //1.创建Socket对象,指明服务器端的ip和端口号 InetAddress inet 阅读全文
posted @ 2022-09-03 16:56 iTao0128 阅读(12) 评论(0) 推荐(0) 编辑
摘要:建立连接 断开连接 阅读全文
posted @ 2022-09-03 13:43 iTao0128 阅读(12) 评论(0) 推荐(0) 编辑
摘要:导入第三方jar:commons-io @Test public void test7() throws IOException { File srcFile = new File("hello.txt"); File destFile = new File("hello2.txt"); //Fil 阅读全文
posted @ 2022-09-02 22:38 iTao0128 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-09-02 22:20 iTao0128 阅读(14) 评论(0) 推荐(0) 编辑
摘要:/* 序列化过程:将内存中的java对象保存到磁盘中或通过网络传输出去,使用ObjectOutputStream */ @Test public void test5() throws IOException { FileOutputStream fos = new FileOutputStream 阅读全文
posted @ 2022-09-02 21:39 iTao0128 阅读(39) 评论(0) 推荐(0) 编辑
摘要:@Test public void test4() throws IOException { InputStreamReader isr = null; try { FileInputStream fis = new FileInputStream("D:\\java.txt"); isr = ne 阅读全文
posted @ 2022-09-01 21:13 iTao0128 阅读(9) 评论(0) 推荐(0) 编辑
摘要:@Test public void test3(){ BufferedInputStream bis = null; BufferedOutputStream bos = null; try { //节点流 FileInputStream fis = new FileInputStream("D:\ 阅读全文
posted @ 2022-09-01 20:51 iTao0128 阅读(4) 评论(0) 推荐(0) 编辑

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