Managing Spring Bean Lifecycle Through Callback Methods

Spring container manages beans from instantiation to destruction, providing hooks for custom initialization and cleanup behavior. This mechanism ensures proper resource acquisition and release. Create a demonstration component with lifecycle-aware methods: package com.springdemo.components; public class ResourceHandler { public void o ...

Posted on Thu, 25 Jun 2026 16:20:06 +0000 by NoobPHP

Resolving JSON Property Mapping Issues with @RequestBody in Spring

When sending JSON data with camelCase properties to a Spring controller, the @RequestBody annotated object may fail to properly map the incoming data if the property naming conventions don't match. // Example problematic request object public class InspectionRequest { private String inspectionId; private String recordDate; private ...

Posted on Wed, 24 Jun 2026 16:46:43 +0000 by roscor

Working with the MongoDB Template API in Spring

MongoTemplate and its reactive counterpart live in the org.springframework.data.mongodb.core package, serving as the core component of Spring's MongoDB integration. It provides a comprehensive feature set for database interactions, including convenient CRUD operations for MongoDB documents and built-in mapping between domain objects and databas ...

Posted on Tue, 23 Jun 2026 16:58:55 +0000 by sam_h

Understanding Spring IOC Container Initialization Flow

What is IOC IOC stands for Inversion of Control. Instead of manually instantiating objects using new, the responsibility for object creation is delegated to the Spring framework. This approach significantly reduces application complexity and minimizes coupling between system components. Application Entry Point public static void main(String[] a ...

Posted on Mon, 22 Jun 2026 18:44:45 +0000 by pppppp

Building a Library Management Module with SSM Framework

Prerequisites Required developmant environment: IntelliJ IDEA MySQL 5.7.19 Tomcat 9 Maven 3.6 Required knowledge: Proficiency in MySQL, Spring, JavaWeb, and MyBatis, along with basic frontend skills. Database Initialization Create a schema for storing publication records: CREATE DATABASE `library_db`; USE `library_db`; DROP TABLE IF EXISTS ` ...

Posted on Mon, 22 Jun 2026 17:17:01 +0000 by sBForum

Understanding the Differences Between BeanFactory and ApplicationContext

Key Distinctions Between BeanFactory and ApplicationContext Interface Hierarchy and Overview Both BeanFactory and ApplicationContext serve as core interfaces with in the Spring framework, functioning as containers for managing beans. Notably, ApplicationContext extends BeanFactory, inheriting its foundational capabilities while adding enhanced ...

Posted on Mon, 22 Jun 2026 16:59:22 +0000 by runestation

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 Custom Extension Buttons in NC65 UAP Environment

Defining the Action Class Create a new Java class that extends nc.ui.uif2.NCAction. This class will contain the logic for your custom button. Ensure you have references to the model and editor components to interact with the UI state. package nc.ui.yrdmd.yrdsellorder.plugin.action; import java.awt.event.ActionEvent; import nc.ui.pub.beans.Mes ...

Posted on Thu, 18 Jun 2026 17:21:51 +0000 by airric

Diagnosing NoClassDefFoundError: A Static Initialization Pitfall

A production alert came in at midnight while the on-call engineer was asleep. After connecting to the environment, it became clear that one microservice was experiencing a steady increase in file descriptor usage, eventually leading to an OutOfMemoryError and service crash. This microservice establishes SSH connections during operation, and sin ...

Posted on Wed, 17 Jun 2026 17:35:17 +0000 by zeberdeee

Invoking REST Endpoints That Return JSON Arrays with Spring RestTemplate

Setting Up the HTTP Client A customized RestTemplate bean provides fine-graineed control over connection behavior. The configuration below binds a request factory with a timeout setting. import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.client.SimpleC ...

Posted on Wed, 10 Jun 2026 18:20:25 +0000 by jdh