Tagged articles
9 articles
Page 1 of 1
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Oct 15, 2023 · Backend Development

How SpringBoot Injects HttpServletRequest via ThreadLocal: A Deep Dive

This article explores how SpringBoot 2.6.12 injects HttpServletRequest into controllers using JDK dynamic proxies and ThreadLocal, detailing the underlying ObjectFactoryDelegatingInvocationHandler, RequestObjectFactory, RequestContextHolder, and DispatcherServlet processing flow with code examples and explains why injecting HttpServletRequest and HttpServletResponse in a controller is safe.

DispatcherServletHttpServletRequestJava
0 likes · 7 min read
How SpringBoot Injects HttpServletRequest via ThreadLocal: A Deep Dive
Top Architect
Top Architect
Aug 6, 2022 · Backend Development

Retrieving Client IP and Using ip2region for IP Geolocation in Java

This article explains how to obtain a client's IP address from HttpServletRequest in Java, convert it to geographic location using the ip2region library, and demonstrates various query methods, caching strategies, and Maven integration for efficient backend IP geolocation.

HttpServletRequestIP geolocationJava
0 likes · 12 min read
Retrieving Client IP and Using ip2region for IP Geolocation in Java
Architecture Digest
Architecture Digest
Aug 3, 2022 · Backend Development

How to Retrieve Client IP and Use ip2region for IP Geolocation in Java

This article explains how to obtain a user's IP address from an HttpServletRequest, introduces the ip2region offline IP‑location library, demonstrates Maven integration and multiple Java query implementations—including file‑only, vector‑index, and full‑memory caching—while providing benchmark and testing instructions.

HttpServletRequestIP geolocationJava
0 likes · 15 min read
How to Retrieve Client IP and Use ip2region for IP Geolocation in Java
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Sep 9, 2021 · Backend Development

Uncovering How SpringBoot Injects HttpServletRequest via ThreadLocal and Dynamic Proxies

This article explains how SpringBoot injects HttpServletRequest into controllers using a JDK dynamic proxy and ThreadLocal storage, tracing the request object from the ObjectFactoryDelegatingInvocationHandler through RequestObjectFactory, RequestContextHolder, and the FrameworkServlet's processRequest lifecycle.

Backend DevelopmentDynamic ProxyHttpServletRequest
0 likes · 7 min read
Uncovering How SpringBoot Injects HttpServletRequest via ThreadLocal and Dynamic Proxies