Tagged articles
5 articles
Page 1 of 1
Code Ape Tech Column
Code Ape Tech Column
Nov 11, 2025 · Backend Development

Pass User Info from Filter to Controller via Spring MVC Argument Resolver

This article explains how to transfer the current user ID extracted from a JWT token in a filter to Spring MVC controller methods using a custom HandlerMethodArgumentResolver, highlighting drawbacks of ThreadLocal and request attributes, and demonstrating a type‑safe, extensible solution with code examples.

HandlerMethodArgumentResolverJavaSpring MVC
0 likes · 11 min read
Pass User Info from Filter to Controller via Spring MVC Argument Resolver
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Feb 18, 2025 · Backend Development

Why Spring MVC Auto‑Binds Header Data to Your DTO – The Hidden Mechanism Explained

This article explores why Spring MVC automatically binds HTTP header values to controller method parameters, demonstrates the issue with a sample Spring Boot 3.4.0 project, analyzes the underlying HandlerMethodArgumentResolver and ServletModelAttributeMethodProcessor code, and provides two practical solutions to prevent unwanted header binding.

HandlerMethodArgumentResolverHeader BindingJava
0 likes · 8 min read
Why Spring MVC Auto‑Binds Header Data to Your DTO – The Hidden Mechanism Explained
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jun 30, 2024 · Backend Development

Simplify JWT Retrieval in Spring Boot Controllers with a Custom Argument Resolver

This article demonstrates how to create a custom HandlerMethodArgumentResolver in Spring Boot that automatically extracts JWT token data and injects the corresponding user object—or selected fields—directly into controller method parameters, reducing boilerplate and improving code readability.

HandlerMethodArgumentResolverJWTSpring Boot
0 likes · 8 min read
Simplify JWT Retrieval in Spring Boot Controllers with a Custom Argument Resolver
Architect's Journey
Architect's Journey
Feb 6, 2023 · Backend Development

Simplify Kafka Consumer Code with a Custom Method Argument Resolver

The article demonstrates how to use Spring's HandlerMethodArgumentResolver to automatically convert Kafka messages into typed method parameters, eliminating repetitive JSON parsing code and showing a complete implementation, usage example, and notes on version support and performance considerations.

HandlerMethodArgumentResolverJavaKafka
0 likes · 6 min read
Simplify Kafka Consumer Code with a Custom Method Argument Resolver
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Oct 29, 2021 · Backend Development

How Spring MVC Resolves Controller Parameters and Builds Custom Argument Resolvers

This article explains the internal workflow of Spring MVC’s HandlerMethodArgumentResolver for processing controller method parameters, walks through the core source code steps, and demonstrates how to implement and register a custom argument resolver using a bespoke annotation.

Custom Argument ResolverHandlerMethodArgumentResolverJava
0 likes · 7 min read
How Spring MVC Resolves Controller Parameters and Builds Custom Argument Resolvers