Creating a Simple Spring Application with Dependency Injection
Basic Hello World Implementation
Create a simple POJO class with a string property:
public class Greeting {
private String message;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
...
Posted on Tue, 22 Sep 2026 16:27:05 +0000 by SyndicatE
Implementing Dependency Injection in Spring: Setter vs. Constructor Injection
Dependency Injection (DI) is a core pattern where an object's dependencies are provided externally rather than the object creating them itself.
Constructor Injection involves providing dependencies through a class's constructor at the time of object creation. This ensures the object is fully initialized and immutable if dependencies are declare ...
Posted on Sat, 05 Sep 2026 16:44:54 +0000 by andrewgauger
Spring Dependency Injection with XML Configuration
Direct Value Injection
Bean properties and constructor arguments can be configured with literal values or references to other managed beans. The value attribute of the <property/> element accepts human-readable string representations, which Spring's conversion service transforms into the appropriate types.
Basic Value Assignment
<bean ...
Posted on Wed, 29 Jul 2026 16:54:09 +0000 by verlen
Implementing the DAO Layer in the SSH Framework
Creating a Generic DAO Interface To avoid repetitive code for common database operations, it's effective to define a generic Data Access Object (DAO) interface. This interface will declare methods that are applicable to any entity.
package com.example.ssh.dao;
/**
* A generic interface for basic CRUD operations on any entity type.
* @param ...
Posted on Fri, 17 Jul 2026 17:21:29 +0000 by slightlyeskew
Spring MVC Configuration Fundamentals
Project Setup and Dependencies
Configure Maven dependencies for Spring MVC web applications:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>spring-web-app</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>
<pr ...
Posted on Wed, 27 May 2026 19:10:51 +0000 by ankit17_ag
MyBatis Parameter Handling Techniques
Passing Parameters in MyBatis
MyBatis provides multiple ways to pass parameters from Java code to XML mapper files. This article explores several common techniques used in parameter handling.
Single Simple Parameter
When a DAO interface method has a single simple paraemter (such as a primitive type or String), you can use any placeholder name i ...
Posted on Mon, 18 May 2026 22:51:41 +0000 by Hatch
Implementing Apache Dubbo Service Exposure via Spring XML Configuration
XML-based configuration remains a practical approach for managing Apache Dubbo RPC endpoints, particularly when decoupling infrastructure settings from application source code. This methodology facilitates environment-specific overrides, centralized version control, and clearer depandency mapping for complex deployments.
Dependency Initializati ...
Posted on Sun, 17 May 2026 06:50:11 +0000 by runeveryday
Understanding Servlet URL Pattern Matching Mechanisms
Exact Path Mapping
An exact match occurs only when the request URL is identical to the string defined in the <url-pattern> tag. This is the most specific form of routing.
<servlet-mapping>
<servlet-name>resourceHandler</servlet-name>
<url-pattern>/secure/login</url-pattern>
</servlet-mapping>
h ...
Posted on Fri, 15 May 2026 01:38:26 +0000 by CybJunior
Mastering Spring IoC Container and Dependency Injection
IoC Container Basics
The Spring IoC (Inversion of Control) container manages application components and their lifecycle. Instead of creating objects manually, you define beans in configuration, and the container handles instantiation and wiring.
Defining Beans
A bean definition specifies how an object should be created and managed. In XML confi ...
Posted on Fri, 08 May 2026 14:14:11 +0000 by SBukoski