摘要: 用于在程序执行过程中拦截或截取特定的操作或事件。它可以在操作发生之前、之后进行自定义的处理。 注册配置拦截器 @Slf4j@Componentpublic class DemoInterceptor implements HandlerInterceptor { @Override public b 阅读全文
posted @ 2024-12-16 10:29 客至在水一方 阅读(42) 评论(0) 推荐(0)
摘要: 过滤器在请求到达目标资源之前或响应返回客户端之前对请求或响应进行拦截和处理,OncePerRequestFilter过滤器逻辑在一次完整的HTTP请求中仅执行一次,即使请求在服务器内部经过了多次转发(forward)或包含多个资源请求。 OncePerRequestFilter的使用 public 阅读全文
posted @ 2024-12-13 16:14 客至在水一方 阅读(180) 评论(0) 推荐(0)
摘要: static final String ALGORITHM = "AES";/** * @Author:AZJ * @Description:生成密钥 * @Date:2022/4/12 16:27 */public static SecretKey generateKey() throws NoS 阅读全文
posted @ 2022-04-12 17:37 客至在水一方 阅读(89) 评论(0) 推荐(0)
摘要: /** * 自定义异常 */public class CustomException extends RuntimeException{ private Integer code; private String message; CustomException(){} CustomException 阅读全文
posted @ 2022-01-04 10:53 客至在水一方 阅读(25) 评论(0) 推荐(0)
摘要: jar包 <dependency> <groupId>com.thoughtworks.xstream</groupId> <artifactId>xstream</artifactId> <version>1.4.9</version></dependency> 工具类 import com.th 阅读全文
posted @ 2021-12-31 17:01 客至在水一方 阅读(366) 评论(0) 推荐(0)