type
status
date
slug
summary
tags
category
icon
password

创建自定义注解

我们创建了一个名为 JwtToken 的注解,它没有任何参数,解释一下注解上面的一些注解:
  • @Target(ElementType.METHOD),Target 说明了 Annotation 所修饰的对象范围,METHOD 用于描述方法
  • @Retention(RetentionPolicy.RUNTIME),运行时注解,注解不仅被保存到class文件中,jvm加载class文件之后,仍然存在
  • @Documented,元注解,表明这个注解应该被 javadoc 工具记录

拦截器

注解拦截器

测试

编写两个测试方法

notion image

发送请求

notion image
notion image
notion image
参考
 
Flex布局居中Json Web Token
Loading...
Kougami
Kougami
Life Will Change
统计
文章数:
18
公告
てへぺりんこ