使用spring initializr创建Springboot项目时,IDEA默认的Server URL为:https://start.spring.io/,可以换成**https://start.aliyun.com**
Classpath
是JVM用来查找用户定义的类、包和资源的路径,即类路径,在target文件夹中的classes里
JDBC:Java数据库连接;JPA: Persistence API ,一种ORM技术
QPS(Query Per Second):服务器每秒可以执行的查询次数
Spring Boot内置了Jackson库,会自动将Java对象转换为JSON格式的字符串
配置启动项:
org.example.studyspring.StudySpringApplication
配置热部署:
spring.devtools.restart.enabled=true
spring.devtools.restart.additional-paths=src/main/java
spring.devtools.restart.exclude=static/**
配置swagger要进行静态资源的映射
*
匹配任意个字符,?
匹配单个字符,**
匹配任意长度的路径(优先级低于*
)@Controller
;如果只请求数据,用@RestController
(相当于@Controller
和 @ResponseBody
的结合),会默认把数据转换成json格式@RequestMapping
用于将Web请求映射到特定的类或方法,参数value
指定URL,method
指定请求方法@RequestBody
用于将请求体里的json数据转换为java的中的类@GetMapping
是@RequestMapping的简化版,指定了请求方法为GET(@RequestParam(”A”,required="false") String B)
把查询字符串中的A映射到参数B中,并且该参数不是必须的{}
进行插值,同时在形参中要用@PathVariable