spring共7篇
Spring框架是一个开放源代码的J2EE应用程序框架,由Rod Johnson发起,是针对bean的生命周期进行管理的轻量级容器(lightweight container)。 Spring解决了开发者在J2EE开发中遇到的许多常见的问题,提供了功能强大IOC、AOP及Web MVC等功能。
Spring Boot项目全局异常处理方式-TOY论坛

Spring Boot项目全局异常处理方式

SpringBoot中,@ControllerAdvice 即可开启全局异常处理,使用该注解表示开启了全局异常的捕获,我们只需在自定义一个方法使用@ExceptionHandler注解然后定义捕获异常的类型即可对这些捕获的异...
springboot项目使用advice做统一返回处理-TOY论坛

springboot项目使用advice做统一返回处理

ResponseBodyAdvice接口 public interface ResponseBodyAdvice<T> { // 是否支持advice功能 // true 支持,false 不支持 boolean supports(MethodParameter returnType, Class<? extends ...
@RequestParam,@PathParam,@PathVariable等注解区别-TOY论坛

@RequestParam,@PathParam,@PathVariable等注解区别

@RequestParam 和 @PathVariable 注解是用于从request中接收请求的,两个都可以接收参数,关键点不同的是@RequestParam 是从request里面拿取值,而 @PathVariable 是从一个URI模板里面来...
Spring Boot条件注解-TOY论坛

Spring Boot条件注解

ConditionalOnBean:是否存在某类或某个名字的BeanConditionalOnMissingBean:是否缺失某个某类或某个名字的BeanConditionalOnSingleCandidate:是否符合指定类型的Bean只有一个ConditionalOnCl...
toywl666的头像-TOY论坛钻石会员toywl6662年前
09111
Spring boot属性绑定-TOY论坛

Spring boot属性绑定

@PropertySourece() my.properties name=kil UserService.java 添加@PropertySource('my.properties')指定配置文件 引用@Value('${name}') package cn.kil.springboot_parameter.service; impor...
Spring boot整合mybatis步骤-TOY论坛

Spring boot整合mybatis步骤

添加数据库以及mybatis maven依赖 jdbc:mybatis包含了spring-boot-starter-jdbc可以不用添加 <!-- mybatis --> <dependency> <groupId>org.mybatis.spring.boot</groupId> <art...
SSM配置MyBatis步骤-TOY论坛

SSM配置MyBatis步骤

1.添加所需maven依赖 maven仓库:https://mvnrepository.com/ <!--Mybatis--> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>...