上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 48 下一页
摘要: 路径变量@PathVariable ①获取指定路径变量: @GetMapping("/car/{id}/owner/{userName}") public Map<String,Object> getCar(@PathVariable("id") int id, @PathVariable("use 阅读全文
posted @ 2022-09-25 14:02 iTao0128 阅读(149) 评论(0) 推荐(0)
摘要: 欢迎页 将index.html放入默认的静态资源路径下,会默认访问。 访问路径:http://localhost:8080/ 如下设置了项目的根访问路径,则欢迎页访问需使用:http://localhost:8080/my/ spring:# mvc:# static-path-pattern: / 阅读全文
posted @ 2022-09-24 22:50 iTao0128 阅读(66) 评论(0) 推荐(0)
摘要: 默认静态资源目录 类路径下:/static、/public、/resources、/META-INF/resources 以下路径下静态资源可直接访问,如http://localhost:8080/hu4.jpeg 原理:静态映射/** 请求进来,先看controller能不能处理,不能处理的所有请 阅读全文
posted @ 2022-09-21 22:46 iTao0128 阅读(142) 评论(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 阅读(54) 评论(0) 推荐(0)
摘要: import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; @Component//组件加入容器中 @Conf 阅读全文
posted @ 2022-09-19 22:41 iTao0128 阅读(37) 评论(0) 推荐(0)
摘要: 条件装配:满足Conditional指定的条件,则进行组件注入 @Configuration//告诉springboot这是一个配置类 public class MyConfig { @Bean("tom") public Stu stu01(){ return new Stu("汤姆"); } @ 阅读全文
posted @ 2022-09-18 22:54 iTao0128 阅读(48) 评论(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 阅读(33) 评论(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 阅读(48) 评论(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 阅读(67) 评论(0) 推荐(0)
摘要: 排除依赖 阅读全文
posted @ 2022-09-12 20:19 iTao0128 阅读(22) 评论(0) 推荐(0)
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 48 下一页