Implementing Dynamic Multi-Criteria Search in Java Web Applications
To implement a robust search feature in a Java-based web application that allows users to filter items (such as products) by multiple optional criteria (e.g., name, category, or status), the most effective approach is to dynamically build the SQL query based on the parameters provided. This ensures that the application only filters by the field ...
Posted on Thu, 09 Jul 2026 17:39:46 +0000 by kee2ka4
Integrating Swagger 2 with Spring Boot for API Documentation and Testing
1. Project Dependencies
Add the following coordinates to your pom.xml to enable Swagger 2 and the enhanced Bootstrap UI theme:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<grou ...
Posted on Thu, 09 Jul 2026 17:07:41 +0000 by LacOniC
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
Java Concurrency Utilities, Platform Environment, and Regular Expressions
Executor FrameworkIn concurrent programming, separating the management of threads from the business logic of tasks creates more maintainable and scalable applications. The java.util.concurrent package provides the Executor framework to handle this decoupling. Instead of explicitly creating threads using new Thread(runnable).start(), developers ...
Posted on Thu, 09 Jul 2026 16:46:38 +0000 by vinnier
Understanding Dubbo Features: Generic Calls, Fallback, and Network Address Binding
Generic Service Invocation
Traditionally, Dubbo services require a shared API jar containing interface definitions. However, generic invocation allows a consumer to call a remote method without having the interface class in its classpath. This is useful for gateway services or dynamic scripting scenarios where the caller only needs to know the ...
Posted on Thu, 09 Jul 2026 16:38:07 +0000 by Fingers68
API Documentation with Swagger in Spring Boot
Swagger Overview
Swagger is an open-source framework that simplifies API documentation by generating interactive, machine-readable specifications from code annotations. It enables frontend and backend teams to collaborate efficiently by providing real-time API documentation and a built-in testing interface.
Project Setup
Maven Dependencies
Add ...
Posted on Thu, 09 Jul 2026 16:18:01 +0000 by avario
Essential Java Standard Library Classes and Methods
String Class
Initializing Strings
Strings can be created using literals or constructors.
Using String Literals
String s1 = null;
String s2 = "";
String s3 = "Hello";
Using Constructors
String s4 = new String(); // Empty string
String s5 = new String("World");
char[] letters = {'J', 'a', 'v', 'a'};
String s6 = new ...
Posted on Thu, 09 Jul 2026 16:02:20 +0000 by Mark.P.W
Java 8: Key Features and Functional Programming Enhancements
Java 8: Key Features and Functional Programming Enhancements
Java 8 (also known as JDK 1.8) represents a significant release in the evolution of the Java programming language. Released by Oracle on March 18, 2014, this version introduced functional programming capabilities, a new JavaScript engine, an enhanced date-time API, and the Stream API ...
Posted on Wed, 08 Jul 2026 17:20:38 +0000 by judgy
Concurrency Control in Java: Comparing synchronized and volatile
synchronized vs volatile
In Java concurrency, synchronized and volatile are two fundamental mechanisms for ensuring thread safety, but they serve different purposes. The synchronized keyword establishes a mutual exclusion lock. When a method or code block is decorated with synchronized, only one thread can execute that critical section at any g ...
Posted on Wed, 08 Jul 2026 17:16:06 +0000 by Averice
Mastering Dynamic SQL in MyBatis: Building Flexible and Maintainable Queries
Dynamic SQL is one of MyBatis’s most powerful features. While basic MyBatis usage simplifies JDBC boilerplate, dynamic SQL empowers developers to construct queries that adapt intelligently to varying runtime conditions—making data access logic both flexible and maintainable.
This guide explores the core constructs of MyBatis dynamic SQL through ...
Posted on Wed, 08 Jul 2026 17:06:29 +0000 by davithedork