1,pom依赖导入 注:spring boot版本须使用2。1.0以下版本,此次使用2.0.9版本 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</a ...
分类:
编程语言 时间:
2021-04-15 12:03:14
阅读次数:
0
项目 新建 Spring Starter Project,编辑 pom.xml 文件,引入依赖: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=" ...
分类:
编程语言 时间:
2021-04-14 12:33:52
阅读次数:
0
程我已经买了,学习,录制,打卡中............. 开篇介绍 大家好,我是Java最全面试题库的提裤姐,今天这篇是JavaEE面试题系列的第二篇,主要总结了SpringMVC相关的问题,在后续,会沿着第一篇开篇的知识线路一直总结下去,做到日更!如果我能做到百日百更,希望你也可以跟着百日百刷, ...
分类:
其他好文 时间:
2021-04-14 12:31:22
阅读次数:
0
SpringMVC概述 SpringMVC通过Spring实现web模块,简化web开发 SpringMVC通过一套MVC注解,让POJO(Plain Ordinary Java Object)成为处理请求的控制器,而无需实现任何接口支持REST风格的URL请求 原生的MVC Model:模型,封装 ...
分类:
编程语言 时间:
2021-04-14 12:09:38
阅读次数:
0
一、全局异常处理之注解方式 主要用到的注解有2个 @ControllerAdvice 用在Controller类级别上,可看做是一个增强的Controller @ExceptionHandler 用到Controller中具体的方法上,表明这个方法处理的具体某个异常类型 我们一般在捕获到异常的时候, ...
分类:
编程语言 时间:
2021-04-14 12:09:04
阅读次数:
0
springboot常用注解 1. @SpringBootApplication 这个注解是 Spring Boot 项目的基石,创建 SpringBoot 项目之后会默认在主类加上。 @SpringBootApplication看作是 @Configuration、@EnableAutoConfi ...
分类:
编程语言 时间:
2021-04-12 12:19:37
阅读次数:
0
1. pom.xml Maven依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId> </dependency> 2. ...
分类:
数据库 时间:
2021-04-10 13:33:58
阅读次数:
0
spring boot还支持yaml格式的配置文件。这种格式文件是JSON超集文件格式,其以数据为中心,扩展名可是是yml和yaml。 yaml格式文件以key/value的格式配置属性,使用缩进控制层级关系。 具体使用如下: 1、value为普通数据类型,根目录下建/config/applicat ...
分类:
移动开发 时间:
2021-04-10 13:31:59
阅读次数:
0
添加 Swagger 依赖 <!-- https://mvnrepository.com/artifact/io.springfox/springfox-boot-starter --> <dependency> <groupId>io.springfox</groupId> <artifactId ...
分类:
编程语言 时间:
2021-04-10 13:06:00
阅读次数:
0
<!-- 普通 --><?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchem ...
分类:
编程语言 时间:
2021-04-10 13:03:21
阅读次数:
0