Implementing Soft Delete with MyBatis Interceptor
@Intercepts({
@Signature(type = StatementHandler.class, method = "prepare", args = {Connection.class, Integer.class})
})
@Component
public class SoftDeleteInterceptor implements Interceptor {
@Override
public Object intercept(Invocation invocation) throws Throwable {
StatementHandler handler = (StatementHandler) in ...
Posted on Fri, 19 Jun 2026 16:59:07 +0000 by vornn
Implementing JWT Authentication in Spring Boot Applications
JSON Web Tokens consist of three distinct segments: a header defining cryptographic parameters, a payload carrying assertions, and a signature ensuring integrity. Implementing token validation in a Spring ecosystem requires orchestrating token generation, externalized configuration, request interception, and MVC registration. The following guid ...
Posted on Wed, 10 Jun 2026 18:12:59 +0000 by henryblake1979
Resolving 'Required request body is missing' in Spring Interceptors
When implementing a custom interceptor in a Spring Boot application to validate specific parameters, an exception Required request body is missing may occur. This issue typically arises after adding an interceptor that reads the request body, causing subsequent attempts to read the body (such as via @RequestBody) to fail.
The root cause is that ...
Posted on Tue, 12 May 2026 14:13:08 +0000 by bond00
Inter-Aspect Communication in Spring AOP: Passing Data Between Advice Methods
Problem Statement
In a flash sale system, I encountered a scenario where one aspect handles Redis-based distributed locking and rate limiting, while another aspect is responsible for publishing order messages to a message queue. The core challenge: how to transmit data computed in the first aspect to the second aspect for further processing.
So ...
Posted on Sun, 10 May 2026 23:46:02 +0000 by Qben
Understanding Interceptors in Java Spring Applications
Core Concepts of Interceptors
In Spring applications, interceptors serve as middleware components designed to execute custom logic before or after HTTP requests are processed. Unlike Aspect-Oriented Programming (AOP), which targets method-level cross-cutting concerns, interceptors specifically focus on the request processing pipeline.
Intercept ...
Posted on Sun, 10 May 2026 20:04:06 +0000 by garethj
Implementing Global Request Logging in Spring Boot with ECharts Dashboard Integration
Database SchemaTable CreationCREATE TABLE `request_audit_log` (
`log_id` BIGINT NOT NULL AUTO_INCREMENT,
`created_at` DATETIME NOT NULL COMMENT 'Request timestamp',
`client_ip` VARCHAR(30) NOT NULL COMMENT 'Client IP address',
`api_category` VARCHAR(50) NOT NULL DEFAULT 'General' COMMENT 'API category',
`endpoint_url` VARCHAR(100) NOT ...
Posted on Fri, 08 May 2026 23:38:15 +0000 by Eskimo887
Microservice Token Authentication and User Information Propagation Scheme
Design Approach
Upon successful login, generate a token using the userId and have the frontend store it.
When subsequent requests reach the gateway, create a filter to parse userId from the token and inject it into the request headers.
Once the request arrives at the target service, create an interceptor to extract userId from the headers, fet ...
Posted on Thu, 07 May 2026 05:44:52 +0000 by edwinlcy