分类
子分类
子分类
标签
排序
Spring Boot项目全局异常处理方式
SpringBoot中,@ControllerAdvice 即可开启全局异常处理,使用该注解表示开启了全局异常的捕获,我们只需在自定义一个方法使用@ExceptionHandler注解然后定义捕获异常的类型即可对这些捕获的异...
springboot项目使用advice做统一返回处理
ResponseBodyAdvice接口 public interface ResponseBodyAdvice<T> { // 是否支持advice功能 // true 支持,false 不支持 boolean supports(MethodParameter returnType, Class<? extends ...
@RequestParam,@PathParam,@PathVariable等注解区别
@RequestParam 和 @PathVariable 注解是用于从request中接收请求的,两个都可以接收参数,关键点不同的是@RequestParam 是从request里面拿取值,而 @PathVariable 是从一个URI模板里面来...
Spring Boot条件注解
ConditionalOnBean:是否存在某类或某个名字的BeanConditionalOnMissingBean:是否缺失某个某类或某个名字的BeanConditionalOnSingleCandidate:是否符合指定类型的Bean只有一个ConditionalOnCl...
Spring boot属性绑定
@PropertySourece() my.properties name=kil UserService.java 添加@PropertySource('my.properties')指定配置文件 引用@Value('${name}') package cn.kil.springboot_parameter.service; impor...
Spring boot整合mybatis步骤
添加数据库以及mybatis maven依赖 jdbc:mybatis包含了spring-boot-starter-jdbc可以不用添加 <!-- mybatis --> <dependency> <groupId>org.mybatis.spring.boot</groupId> <art...
SSM配置MyBatis步骤
1.添加所需maven依赖 maven仓库:https://mvnrepository.com/ <!--Mybatis--> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>...
outguo2年前1
里面教程有点糊,不过全部可以正常运行listuoi2年前1
给宝塔面板挺好的?toycly2年前1
非常完美?????yiyun2年前0
挺全的,可惜要挂机宝。