Tag: spring
All the articles with the tag "spring".
Custom YAML Configuration in Spring Boot
How can you define your own Spring Boot YAML configuration, and what conventions should you follow? This article shares the approach I developed through hands-on practice.
Understanding Spring IoC
An exploration of Spring IoC through bean creation and dependency injection, including constructors, factory methods, and setters. The article also traces component scanning in the source code to see how annotated classes become bean definitions and how the container manages objects and their dependencies.
How Does Spring Perform Property Injection?
Analyzes Spring’s setter and constructor injection workflows through the dependency between two beans. By tracing property resolution and getBean calls, it explains how existing dependencies are reused and missing dependencies are created, and compares when the two injection methods run.
When Does Spring Instantiate Beans?
Starting from XML configuration, this article uses source-code debugging to examine bean definition registration, object creation, property population, and initialization in Spring. It explains how BeanFactory stores the relevant information and compares when non-lazy singleton and prototype beans are created during container startup or actual use.
Using Shiro: Complete Spring Boot Integration Code
The main code for integrating Shiro, Spring Boot, and JWT: the Shiro configuration, a custom Realm, an authentication filter, and a JWT utility. Together, these four pieces show login authentication, request interception, and token creation and validation, with a look back at the session-management choices made during integration.
Using Shiro: Integrating JWT for More Capable Tokens
JWT is integrated with Shiro and Spring Boot to issue tokens after login and parse, validate, and check them for expiry on subsequent requests. This article explains the JWT utility, authentication filter, and configuration properties, and traces a dependency-injection failure caused by constructing the filter manually.
Using Shiro with Tokens
A custom Shiro filter validates tokens on incoming requests. The article covers returning a token after login, adding the filter to the authentication chain, and tracing filter execution order in the source code, then discusses token expiry and distributed authentication that the example has not yet implemented.
Using Shiro Remember Me and Automatic Login: Fixing a deleteMe Cookie
Introduces Shiro rememberMe configuration and automatic login on a later visit, and records a source-code investigation of cookies containing deleteMe. Making the User object used in authentication implement Serializable resolves the serialization failure that breaks the remember-me feature.