Understanding and Using Struts2 Interceptors

Struts2 interceptors are a core mechanism for implementing cross-cutting concerns in web applications, leveraging aspect-oriented programming principles. Similar in concept to servlet filters, interceptors execute logic before and after an action method is invoked. However, unlike filters that operate at the servlet container level, Struts2 int ...

Posted on Fri, 14 Aug 2026 16:51:28 +0000 by mbeals

Implementing Multiple Data Sources with Druid in Spring Boot

Componant Implementation DataSource Annotation DataSource.java AspectJ Implementation DataSourceAspect.java Data Source Constants DataSourceConstants.java Dynamic Data Source DynamicDataSource.java Configuration DataSourceConfig.java DataSource Annotation package com.example.datasource.config; import java.lang.annotation.*; ...

Posted on Thu, 13 Aug 2026 16:42:52 +0000 by sweetmaster

Day 3 Part 1: Dish Management (AOP, Custom Annotations, Reflection, File Upload)

The automatic filling of common fields primarily uses AOP (Aspect-Oriented Programming), involving reflection mechanisms and custom annotations. For adding new dishes, we learn about file upload techniques using Alibaba Cloud OSS for cloud storage, along with handling relationships between two tables—retrieving dish IDs from the dish_flavor tab ...

Posted on Sun, 09 Aug 2026 16:04:58 +0000 by tzuriel

Implementing System Operation Logs with Spring AOP

Custom Annotation for Logging Define an annotation to mark methods requiring logging: @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface AuditLog { String category() default ""; String action() default ""; } Log Entity Structure Create a data model for log records: @Data public class S ...

Posted on Wed, 29 Jul 2026 16:57:51 +0000 by ipruthi

Implementing Common Field Auto-Fill in Java Spring Boot Monolithic Applications

1. Custom Annotation for Auto-Fill Define a custom annotation to mark methods that require automatic field populatoin. import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) p ...

Posted on Tue, 28 Jul 2026 16:59:24 +0000 by Knutty

Implementing Aspect-Oriented Programming with Spring AOP and AspectJ

Fundamentals of Aspect-Oriented Programming Core Concepts AOP (Aspect Oriented Programming) is a programming paradigm focused on modularizing cross-cutting concerns. While OOP structures code around classes and objects, AOP concentrates on separating common functionalities—such as logging, security, or transaction management—from the core busin ...

Posted on Wed, 22 Jul 2026 17:04:00 +0000 by terry2

AOP in the HarmonyOS Architecture

Introduction to AOP For developers familiar with Android or Java Web development, the concept of Aspect-Oriented Programming (AOP) is well-established. The core of AOP lies in identifying an aspect and then performing pre-processing or post-processing on a specific business operation, or even replacing the operation entirely. The granularity of ...

Posted on Thu, 16 Jul 2026 16:26:55 +0000 by gtibok

Implementing Aspect-Oriented Programming with Spring XML Configuration

Configuring AOP Using XML in Spring Spring supports aspect-oriented programming through both annotations and XML-based configuration. While annotation-driven AOP is more common in modern applications, XML configuration remains a viable and explicit alternative—especially in legacy or highly controlled enviroments. 1. Defining the Aspect Class T ...

Posted on Wed, 15 Jul 2026 16:35:11 +0000 by yaba

Spring IOC and AOP Core Concepts Explained

IOC Section 1. Spring Ecosystem Overview Spring is a comprehensive ecosystem providing essential infrastructure for Java application development. The Spring ecosystem typically consists of: Spring Framework - the core framework Spring Boot - adds auto-configuration capability, which reads Spring Boot Starter configuration during startup, initi ...

Posted on Mon, 13 Jul 2026 16:40:50 +0000 by s.eardley

Implementing Nested DataSource Context Holder with ThreadLocal Deque

DataSource Context Holder Implementation Based on Deque public class DataSourceContextManager { // Using ThreadLocal<Deque> to support nested data sources private static final ThreadLocal<Deque<DataSourceEnum>> CONTEXT_HOLDER = ThreadLocal.withInitial(ArrayDeque::new); /** * Push data source type ...

Posted on Thu, 09 Jul 2026 16:50:33 +0000 by dodgei