springboot 事件监听(@EventListener实现) 应用:使用注解实现事件监听 ********************** 相关注解 @EventListener @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE}) ...
分类:
编程语言 时间:
2021-04-06 14:35:53
阅读次数:
0
SpringBootApplication 注解作用:用来表示这是一个SpringBoot的入口类,这个注解只能出现一次 详解: @SpringBootApplication 派生注解 | 组合注解,等效于以下三个注解 @SpringBootConfiguration # 标识注解,标识这是一个Sp ...
分类:
编程语言 时间:
2020-10-24 10:19:17
阅读次数:
25
切面相关注解: @Aspect : 声明该类为一个注解类 @Pointcut : 定义一个切点 @Before : 在切点之前执行 @After : 在切点之后执行 不管目标方法是否执行成功 @AfterReturning : 切点返回内容后执行代码,可以对切点的返回值进行封装 @AfterThro ...
分类:
编程语言 时间:
2020-10-22 22:49:05
阅读次数:
30
一、Controller相关注解 1、@Controller与@RestController注解 ①@Controller:添加在Controller 类上,指定Spring类的实例是一个控制器。 ②@RestController:添加在Controller 类上,是一个复合注解,它包含了@Cont ...
分类:
编程语言 时间:
2020-07-27 15:56:17
阅读次数:
68
项目文件结构 编写测试代码 添加lombok的依赖 新建DemoController,用于提供RESTful接口。增加相关注解:@RestController,@RequestMapping("/demo"),@Slf4j 新建GetUserParam,接口传入参数实体。 新建DemoErrorEn ...
分类:
编程语言 时间:
2020-07-17 16:08:33
阅读次数:
64
需求分析 针对VideoService接口实现日志打印 三个核心包 spring-aop:AOP核心功能,例如代理工厂 aspectjweaver:简单理解,支持切入点表达式 aspectjrt:简单理解,支持aop相关注解 定义Service接口和实现类 VideoService.java pac ...
分类:
编程语言 时间:
2020-07-15 22:58:16
阅读次数:
72
开发技术 开发系统: Win10+IDEA+MySQL8+Tomcat8.5+Spring4+SpringMVC4+Mybatis3 开发技术: MySQL+Spring+SpringMVC+Mybatis 开发流程 首先完成数据库的设计 完成项目模块划分及配置 完成部门管理与个人中心 最后完成报销 ...
分类:
其他好文 时间:
2020-06-10 13:10:45
阅读次数:
110
常用注解★★★★★:注解本身没有功能的,就和 xml 一样。注解和 xml 都是一种元数据,元数据即解释数据的数据,这就是所谓配置。本文主要罗列 Spring|Spring MVC相关注解的简介。Spring部分1、声明bean的注解@Component 组件,没有明确的角色@Service 在业务... ...
分类:
编程语言 时间:
2020-06-09 23:25:39
阅读次数:
75
一、相关注解 @GetMapping:等价于@RequestMapping(method=RequestMethod.GET) @PostMapping:等价于@RequestMapping(method=RequestMethod.POST) @PutMapping:等价于@RequestMapp ...
分类:
其他好文 时间:
2020-05-26 20:41:31
阅读次数:
68
一、Spring MVC 相关注解 1、@RequestMapping (1)功能: 将 HTTP 请求 与 请求处理类中的方法 进行映射。 通过 RequestMappingHandlerMapping 与 RequestMappingHandlerAdapter 两个类来支持该注解。 (2)常用 ...
分类:
编程语言 时间:
2020-04-27 19:38:46
阅读次数:
67