Tagged articles
84 articles
Page 1 of 1
java1234
java1234
Apr 30, 2026 · Backend Development

Designing Clean Backend APIs: Unified Responses, Validation, and Exception Handling in Spring

The article explains how to refactor Spring controller code by introducing a unified response structure, using ResponseBodyAdvice for automatic wrapping, fixing String conversion issues through message‑converter ordering, applying JSR‑303 validation (including custom validators), and implementing custom exceptions with a global exception handler, resulting in concise, maintainable backend APIs.

Controllerbackendapiexceptionhandling
0 likes · 18 min read
Designing Clean Backend APIs: Unified Responses, Validation, and Exception Handling in Spring
Java Backend Full-Stack
Java Backend Full-Stack
Sep 12, 2025 · Backend Development

How to Handle Exceptions Thrown by Threads in a ThreadPool

This article explains why tasks submitted to a Java ThreadPool via submit silently swallow exceptions while execute prints them, and demonstrates three practical ways—using Future.get(), a custom UncaughtExceptionHandler, and overriding afterExecute—to reliably capture and process those exceptions.

ExecutorServiceFutureJava
0 likes · 14 min read
How to Handle Exceptions Thrown by Threads in a ThreadPool
Code Ape Tech Column
Code Ape Tech Column
Sep 10, 2025 · Backend Development

How to Capture Exceptions from Java ThreadPoolExecutor: submit vs execute

This article explains why tasks submitted with ExecutorService.submit silently swallow exceptions while execute prints them, and demonstrates three practical ways—try‑catch, Thread.setDefaultUncaughtExceptionHandler, and overriding afterExecute—to reliably retrieve exception information from a Java thread pool.

ExecutorServiceFutureJava
0 likes · 14 min read
How to Capture Exceptions from Java ThreadPoolExecutor: submit vs execute
Su San Talks Tech
Su San Talks Tech
Sep 9, 2025 · Backend Development

Why @Transactional Fails: 13 Hidden Pitfalls and How to Fix Them

Spring’s @Transactional annotation often appears simple, yet it can silently fail due to unnecessary usage, scope issues, proxy limitations, propagation settings, exception handling, and bean management, leading to unexpected non‑rollback behavior; this article categorizes thirteen common pitfalls and demonstrates each with concrete code examples.

Javaaopexceptionhandling
0 likes · 18 min read
Why @Transactional Fails: 13 Hidden Pitfalls and How to Fix Them
Java Tech Enthusiast
Java Tech Enthusiast
Aug 25, 2025 · Backend Development

Refactoring Spring Controllers for Unified Responses and Robust Validation

This article explains why the Controller layer remains essential in modern Spring applications, identifies common problems such as tangled validation and inconsistent responses, and demonstrates how to introduce a unified result structure, use ResponseBodyAdvice for automatic wrapping, fix String conversion issues, apply JSR‑303 validation, create custom validators, and handle exceptions uniformly.

Controllerexceptionhandlingresponsebodyadvice
0 likes · 22 min read
Refactoring Spring Controllers for Unified Responses and Robust Validation
Top Architect
Top Architect
Aug 21, 2025 · Backend Development

Master 10 Essential Spring Extension Points for Robust Backend Development

This article walks through the ten most useful Spring extension points—including global exception handling, custom interceptors, bean access, @Import usage, startup runners, BeanDefinition modification, initialization callbacks, BeanPostProcessor hooks, destroy callbacks, and custom scopes—providing clear explanations and ready‑to‑use code examples for each.

BackendBeanFactoryBeanPostProcessor
0 likes · 17 min read
Master 10 Essential Spring Extension Points for Robust Backend Development
Architect's Guide
Architect's Guide
Jul 22, 2025 · Backend Development

How to Refactor SpringBoot Controllers for Unified Responses and Robust Validation

This article shows how to refactor SpringBoot controller code by introducing a unified Result wrapper, ResponseBodyAdvice, proper HttpMessageConverter ordering, JSR‑303 validation (including custom validators), and centralized exception handling, resulting in concise, maintainable backend code with consistent API responses.

Controllerexceptionhandlingresponsebodyadvice
0 likes · 17 min read
How to Refactor SpringBoot Controllers for Unified Responses and Robust Validation
Java One
Java One
Jul 9, 2025 · Backend Development

Mastering Spring Alibaba Sentinel: Architecture, Flow Control, and Custom Error Handling

This tutorial walks through the core concepts of Spring Alibaba Sentinel, covering its architecture, resource and rule management, step‑by‑step integration into Spring Cloud projects, flow‑control configuration, custom exception handling with @SentinelResource, and advanced OpenFeign support, all illustrated with code snippets and diagrams.

FlowControlJavaMicroservices
0 likes · 15 min read
Mastering Spring Alibaba Sentinel: Architecture, Flow Control, and Custom Error Handling
Top Architecture Tech Stack
Top Architecture Tech Stack
May 23, 2025 · Backend Development

Best Practices for Designing a Robust Spring MVC Controller Layer

This article explains the essential responsibilities of a Spring MVC controller, identifies common pitfalls such as duplicated validation and inconsistent responses, and demonstrates how to unify response structures, handle String conversion issues, apply JSR‑303 validation, create custom validators, and implement centralized exception handling using ResponseBodyAdvice and @RestControllerAdvice.

ControllerSpring MVCexceptionhandling
0 likes · 17 min read
Best Practices for Designing a Robust Spring MVC Controller Layer
Top Architecture Tech Stack
Top Architecture Tech Stack
May 20, 2025 · Backend Development

Global Exception Handling in Spring Boot: Techniques and Code Examples

This article explains how to efficiently handle exceptions in Spring Boot applications by using @ControllerAdvice and @ExceptionHandler annotations, providing step-by-step code examples for custom global exception classes, error response structures, and handling specific exceptions such as business, null pointer, and type conversion errors.

BackendJavaSpringBoot
0 likes · 9 min read
Global Exception Handling in Spring Boot: Techniques and Code Examples
Selected Java Interview Questions
Selected Java Interview Questions
May 14, 2025 · Backend Development

Enterprise Java Core Features: Full‑Chain Logging, Unified Exception Handling, Permission Interceptor, and Thread Context Management

This article presents a comprehensive guide to implementing full‑chain log tracing, unified exception handling, permission interception, request latency monitoring, and standardized log formats in enterprise‑level Java projects using Spring AOP, thread‑local context, and Redis caching.

SecurityThreadLocalaop
0 likes · 23 min read
Enterprise Java Core Features: Full‑Chain Logging, Unified Exception Handling, Permission Interceptor, and Thread Context Management
Top Architecture Tech Stack
Top Architecture Tech Stack
Apr 16, 2025 · Backend Development

Improving Spring Controller Design: Unified Response Structure, Validation, and Exception Handling

This article explains how to refactor Spring MVC controllers by introducing a unified response wrapper, using ResponseBodyAdvice for automatic packaging, handling String conversion issues, applying JSR‑303 validation for request parameters, creating custom validators, and defining centralized exception handling to keep controller code clean and maintainable.

ControllerJavaexceptionhandling
0 likes · 17 min read
Improving Spring Controller Design: Unified Response Structure, Validation, and Exception Handling
Top Architecture Tech Stack
Top Architecture Tech Stack
Mar 26, 2025 · Backend Development

Global Exception Handling in SpringBoot: Custom Handlers, Enums, and Response Wrappers

This article explains how to implement unified global exception handling in SpringBoot by using @ControllerAdvice with @ExceptionHandler, defining a base error interface, custom enums, exception classes, and a standardized response wrapper, while also providing test code examples and best‑practice recommendations.

CustomExceptionGlobalExceptionJava
0 likes · 10 min read
Global Exception Handling in SpringBoot: Custom Handlers, Enums, and Response Wrappers
IT Services Circle
IT Services Circle
Mar 13, 2025 · Backend Development

Common Pitfalls When Using CompletableFuture in Java

This article introduces the advantages of Java's CompletableFuture and systematically outlines six common pitfalls—including default thread‑pool issues, exception handling, timeout management, thread‑local context loss, callback hell, and task‑ordering problems—while providing correct code examples and best‑practice recommendations.

AsyncCompletableFutureJava
0 likes · 10 min read
Common Pitfalls When Using CompletableFuture in Java
Java Backend Technology
Java Backend Technology
Feb 28, 2025 · Backend Development

Refactor Spring Controllers for Unified Responses and Robust Validation

This article explains why Controllers are essential in Spring MVC, identifies common problems such as tangled validation and inconsistent responses, and demonstrates how to introduce a unified return structure, use ResponseBodyAdvice for automatic wrapping, handle String conversion issues, apply JSR‑303 validation, create custom validators, and centralize exception handling to produce cleaner, more maintainable backend code.

Controllerexceptionhandlingresponsebodyadvice
0 likes · 19 min read
Refactor Spring Controllers for Unified Responses and Robust Validation
Architecture Digest
Architecture Digest
Dec 29, 2024 · Backend Development

Refactoring Spring MVC Controllers: Unified Return Structure, Response Advice, Parameter Validation, and Global Exception Handling

This article explains how to refactor the Spring MVC controller layer by introducing a unified response format, using ResponseBodyAdvice for automatic wrapping, fixing String conversion issues, applying JSR‑303 validation, creating custom validators, and handling exceptions globally to keep controller code clean and maintainable.

ControllerJavaexceptionhandling
0 likes · 18 min read
Refactoring Spring MVC Controllers: Unified Return Structure, Response Advice, Parameter Validation, and Global Exception Handling
JD Cloud Developers
JD Cloud Developers
Dec 17, 2024 · Backend Development

What Happens When a Thread in a Java ThreadPool Throws an Exception?

This article examines how Java's ExecutorService thread pool reacts when a task throws an uncaught exception, comparing the behaviors of execute and submit methods, analyzing source code, and summarizing the impact on thread removal, creation, and exception retrieval.

ExecutorServiceJavaThreadPool
0 likes · 7 min read
What Happens When a Thread in a Java ThreadPool Throws an Exception?
Architect's Tech Stack
Architect's Tech Stack
Nov 27, 2024 · Backend Development

Refactoring Spring Boot Controllers: From Messy Code to Clean, Validated, and Exception‑Handled Design

This article examines common problems in Spring Boot controller implementations—excessive try‑catch blocks, inline validation, and business logic leakage—and demonstrates how to refactor them using @Valid, assertion utilities, and a global exception handler to achieve concise, maintainable backend code.

BackendControllerJava
0 likes · 9 min read
Refactoring Spring Boot Controllers: From Messy Code to Clean, Validated, and Exception‑Handled Design
Top Architecture Tech Stack
Top Architecture Tech Stack
Nov 6, 2024 · Backend Development

Improving Spring Boot Controllers: From Messy to Elegant with @Valid and Global Exception Handling

The article examines common pitfalls in Spring Boot controller implementations—excessive try‑catch blocks, inline validation, and business logic—then demonstrates how to refactor them into clean, maintainable code using @Valid annotations, reduced duplication, and a centralized global exception handler.

ControllerSpringBootexceptionhandling
0 likes · 8 min read
Improving Spring Boot Controllers: From Messy to Elegant with @Valid and Global Exception Handling
macrozheng
macrozheng
Oct 18, 2024 · Backend Development

Why @Transactional Often Fails: 13 Real-World Pitfalls and How to Fix Them

An in‑depth guide reveals thirteen common pitfalls that cause Spring’s @Transactional annotation to malfunction—ranging from unnecessary usage and proxy limitations to propagation misconfigurations and exception handling—plus practical demos and solutions to ensure reliable transaction rollbacks in Java backend development.

BackendJavaaop
0 likes · 20 min read
Why @Transactional Often Fails: 13 Real-World Pitfalls and How to Fix Them
Top Architect
Top Architect
Oct 13, 2024 · Backend Development

Spring Boot Project Initialization, Version Management, and Common Backend Utilities Tutorial

This article walks through creating a Spring Boot project, handling version compatibility between Spring Cloud, Spring Boot, and Kafka, demonstrates common Maven configurations, provides global exception handling and logging aspects, and lists useful backend tools such as embedded Redis, MyBatis‑Plus, and Redisson.

JavaSpringBootVersionManagement
0 likes · 13 min read
Spring Boot Project Initialization, Version Management, and Common Backend Utilities Tutorial
Architecture Digest
Architecture Digest
Oct 13, 2024 · Backend Development

Improving Spring MVC Controllers: Unified Response Structure, Validation, and Exception Handling

The article explains how to simplify Spring MVC controller code by introducing a unified response wrapper, handling String return types with ResponseBodyAdvice, adjusting HttpMessageConverter order, applying JSR‑303 validation for @RequestParam, @PathVariable and @RequestBody, creating custom validation annotations, and implementing global exception handling for consistent API responses.

BackendControllerJava
0 likes · 18 min read
Improving Spring MVC Controllers: Unified Response Structure, Validation, and Exception Handling
IT Services Circle
IT Services Circle
Sep 14, 2024 · Backend Development

Spring Transaction Pitfalls: Common Scenarios Where Transactions Fail and How to Fix Them

This article explains the most common reasons why Spring @Transactional annotations may become ineffective or fail to roll back, covering access‑modifier issues, final methods, internal calls, self‑injection, multithreading, unsupported table engines, mis‑configured propagation, exception handling, nested transactions, large‑transaction problems, and the advantages of programmatic transaction management.

Javaaopdatabase
0 likes · 20 min read
Spring Transaction Pitfalls: Common Scenarios Where Transactions Fail and How to Fix Them
Code Ape Tech Column
Code Ape Tech Column
Aug 26, 2024 · Backend Development

Handling Exceptions in Java ThreadPool: submit vs execute and Custom Solutions

This article explains why exceptions thrown by tasks submitted to a Java thread pool behave differently with submit and execute, demonstrates how to capture those exceptions using Future.get, try‑catch, Thread.setDefaultUncaughtExceptionHandler, and by overriding afterExecute, and provides complete code examples for each approach.

ExecutorServiceJavaThreadPool
0 likes · 13 min read
Handling Exceptions in Java ThreadPool: submit vs execute and Custom Solutions
Code Ape Tech Column
Code Ape Tech Column
Aug 2, 2024 · Backend Development

Improving Spring MVC Controllers: Unified Response Structure, Validation, and Exception Handling

This article explains how to refactor Spring MVC controller layers by introducing a unified response wrapper, handling String conversion issues with ResponseBodyAdvice, applying JSR‑303 validation for request parameters, creating custom validation annotations, and implementing custom exceptions with a global exception handler to produce clean, maintainable backend code.

BackendControllerJava
0 likes · 21 min read
Improving Spring MVC Controllers: Unified Response Structure, Validation, and Exception Handling
Top Architect
Top Architect
Aug 1, 2024 · Backend Development

Best Practices for Designing a Robust Controller Layer in Spring Backend Applications

This article explains how to build a clean, maintainable Controller layer in Spring by separating responsibilities, unifying response structures, applying global response wrapping, leveraging JSR‑303 validation for parameters, creating custom validation rules, and handling exceptions uniformly, all illustrated with practical Java code examples.

ControllerJavaexceptionhandling
0 likes · 18 min read
Best Practices for Designing a Robust Controller Layer in Spring Backend Applications
Architect's Guide
Architect's Guide
Jul 16, 2024 · Backend Development

Refactoring Spring Boot Controllers: From Messy to Elegant

The article critiques overly complex Spring Boot controllers filled with repetitive validation and business logic, demonstrates cleaner implementations using @Valid, Assert, and global exception handling, and provides practical code examples and guidelines for building maintainable backend controllers.

@ValidBackendJava
0 likes · 10 min read
Refactoring Spring Boot Controllers: From Messy to Elegant
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jun 20, 2024 · Backend Development

Mastering Unified Response and Global Exception Handling in Spring Boot 3

This tutorial explains how to implement a standardized response format and a global exception handling mechanism in Spring Boot 3, providing reusable code examples, status enums, controller advice, and best‑practice guidelines to improve code consistency, readability, and maintainability across backend projects.

APISpringBootexceptionhandling
0 likes · 10 min read
Mastering Unified Response and Global Exception Handling in Spring Boot 3
Java Architect Essentials
Java Architect Essentials
Jun 10, 2024 · Backend Development

Designing an Excellent Controller Layer in Java Spring

This article explains how to build a clean, maintainable Controller layer in Java Spring by separating responsibilities, using unified response structures, applying ResponseBodyAdvice for automatic wrapping, implementing parameter validation with JSR‑303, and handling custom exceptions through centralized advice, illustrated with comprehensive code examples.

ControllerJavaexceptionhandling
0 likes · 15 min read
Designing an Excellent Controller Layer in Java Spring
Top Architect
Top Architect
Jun 8, 2024 · Backend Development

Comprehensive Guide to Java BigDecimal: Overview, Constructors, Methods, Formatting, Exceptions, and Utilities

This article provides an in‑depth tutorial on Java's BigDecimal class, covering its purpose, common constructors, essential arithmetic methods, comparison techniques, formatting with NumberFormat, handling of division exceptions, and a utility class offering precise add, subtract, multiply, divide, rounding, and comparison operations.

ArithmeticBigDecimalJava
0 likes · 16 min read
Comprehensive Guide to Java BigDecimal: Overview, Constructors, Methods, Formatting, Exceptions, and Utilities
dbaplus Community
dbaplus Community
Jun 3, 2024 · Backend Development

Why Your ScheduledExecutorService Stops After an Exception—and How to Fix It

A mis‑handled exception in a ScheduledExecutorService can silently halt the entire scheduled thread pool, causing critical periodic jobs to stop; this article explains the underlying delay‑queue and thread‑pool mechanics, shows reproducible code, and provides practical safeguards to keep scheduled tasks alive.

DelayQueueJavaScheduledExecutorService
0 likes · 9 min read
Why Your ScheduledExecutorService Stops After an Exception—and How to Fix It
Xuanwu Backend Tech Stack
Xuanwu Backend Tech Stack
May 12, 2024 · Backend Development

Master Spring Global Exception & Data Handling with @ControllerAdvice

Learn how to use Spring's @ControllerAdvice, @ExceptionHandler, @InitBinder, and @ModelAttribute annotations to implement global exception handling, data binding, and pre-processing, including custom exceptions, order control with @Order, and practical code examples for robust backend development.

ControllerAdviceDataBindingJava
0 likes · 12 min read
Master Spring Global Exception & Data Handling with @ControllerAdvice
JD Tech
JD Tech
Apr 15, 2024 · Backend Development

How Java Thread Pools Handle Exceptions: execute vs submit

This article investigates how Java's java.util.concurrent.ExecutorService thread pools react to exceptions when tasks are submitted via execute versus submit, providing source‑code experiments, observed outcomes, and a detailed analysis of the underlying JDK implementation.

ExecutorServiceJavaThreadPool
0 likes · 8 min read
How Java Thread Pools Handle Exceptions: execute vs submit
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Mar 22, 2024 · Backend Development

Master Spring Boot: Unified Paths, Static Resources, Validation, and More

Learn how to configure Spring Boot 2.7.16 for unified API prefixes, custom static resource locations, annotation‑based and custom parameter validation, global exception handling, request inspection via HttpEntity, CORS filtering, custom error pages, and reliable ServletContext access using ApplicationListener.

CORSConfigurationServletContext
0 likes · 7 min read
Master Spring Boot: Unified Paths, Static Resources, Validation, and More
Architect's Guide
Architect's Guide
Feb 9, 2024 · Backend Development

How to Capture Exceptions from Java ThreadPool Tasks: submit vs execute and Three Solutions

This article explains why exceptions from tasks submitted to a Java ThreadPool using submit are not printed, how execute shows them, and presents three practical approaches—try‑catch within the task, a custom Thread.setDefaultUncaughtExceptionHandler, and overriding afterExecute—to reliably obtain and handle those exceptions.

ExecutorServiceFutureJava
0 likes · 14 min read
How to Capture Exceptions from Java ThreadPool Tasks: submit vs execute and Three Solutions
Architect's Guide
Architect's Guide
Feb 1, 2024 · Fundamentals

Java 8 Functional Interfaces: Function, Supplier, Consumer, Runnable and Practical Usage Patterns

This article introduces Java 8 functional interfaces—including Function, Supplier, Consumer, and Runnable—explains their signatures, demonstrates how they can replace traditional if‑else statements for exception handling, branch processing, and null checks, and provides concrete code examples and usage tips.

BackendFunctionalInterfaceJava
0 likes · 7 min read
Java 8 Functional Interfaces: Function, Supplier, Consumer, Runnable and Practical Usage Patterns
Selected Java Interview Questions
Selected Java Interview Questions
Nov 18, 2023 · Backend Development

A Comprehensive Guide to Java CompletableFuture: Replacing Future and CountDownLatch with Elegant Asynchronous Patterns

This article explains Java's Future and CompletableFuture APIs, demonstrates how to replace blocking Future.get() and CountDownLatch patterns with CompletableFuture, shows creation methods, result retrieval options, callback chains, exception handling, task composition techniques, and provides best‑practice recommendations for thread‑pool usage.

AsynchronousCompletableFutureFuture
0 likes · 22 min read
A Comprehensive Guide to Java CompletableFuture: Replacing Future and CountDownLatch with Elegant Asynchronous Patterns
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Nov 2, 2023 · Backend Development

Rethinking Global Exception Handling in SpringBoot Applications

This article examines the pitfalls of using SpringBoot's @ControllerAdvice and @ExceptionHandler for global exception handling, illustrates common issues across controller, service, and data layers, and proposes more precise logging and debugging strategies to improve error traceability and maintainability.

BackendDebuggingJava
0 likes · 7 min read
Rethinking Global Exception Handling in SpringBoot Applications
Code Ape Tech Column
Code Ape Tech Column
Oct 20, 2023 · Backend Development

Handling Exceptions in Java ThreadPool: submit vs execute and Practical Solutions

This article explains why exceptions submitted to a Java ThreadPool via submit are not printed, how to retrieve them using Future.get(), and presents three practical solutions—including try‑catch, Thread.setDefaultUncaughtExceptionHandler, and overriding afterExecute—to reliably capture and process thread pool exceptions.

ExecutorServiceJavaThreadPool
0 likes · 15 min read
Handling Exceptions in Java ThreadPool: submit vs execute and Practical Solutions
Architecture Digest
Architecture Digest
Sep 15, 2023 · Backend Development

Unified Exception Handling in Spring Boot Using @ControllerAdvice, Custom Assertions, and Enums

This article explains how to replace repetitive try‑catch blocks in Java Spring applications with a unified exception handling mechanism that leverages @ControllerAdvice, custom Assert utilities, enum‑based error codes, and standardized response objects to improve code readability, maintainability, and internationalization.

AssertBackendJava
0 likes · 19 min read
Unified Exception Handling in Spring Boot Using @ControllerAdvice, Custom Assertions, and Enums
Java Architect Essentials
Java Architect Essentials
Sep 4, 2023 · Backend Development

Using CompletableFuture for Asynchronous Programming in Java: Examples and Best Practices

This article explains Java asynchronous programming by first showing the limitations of the JDK5 Future interface, then demonstrating how CountDownLatch can coordinate tasks, and finally presenting CompletableFuture creation, result retrieval, callback chaining, exception handling, and multi‑task composition with practical code examples.

CompletableFutureFutureJava
0 likes · 20 min read
Using CompletableFuture for Asynchronous Programming in Java: Examples and Best Practices
Architect's Tech Stack
Architect's Tech Stack
Aug 13, 2023 · Backend Development

Handling Exceptions in Java Thread Pools: submit vs execute and Custom Strategies

This article explains why tasks submitted with ExecutorService.submit silently swallow exceptions, how ExecutorService.execute prints them, and presents three practical solutions—including try‑catch, a custom ThreadFactory with UncaughtExceptionHandler, and overriding afterExecute—to reliably capture and process thread‑pool errors in Java.

ExecutorServiceJavaThreadPool
0 likes · 14 min read
Handling Exceptions in Java Thread Pools: submit vs execute and Custom Strategies
Top Architect
Top Architect
Aug 9, 2023 · Backend Development

Unified Exception Handling in Spring Boot: Design, Implementation, and Best Practices

This article explains how to design and implement a unified exception handling framework in Spring Boot applications, covering background, the use of @ControllerAdvice and @ExceptionHandler, custom assertion utilities, error response structures, handling of various exception types, and practical validation examples with code snippets.

JavaSpringBootUnifiedError
0 likes · 22 min read
Unified Exception Handling in Spring Boot: Design, Implementation, and Best Practices
Architecture Digest
Architecture Digest
Aug 4, 2023 · Backend Development

Unified Exception Handling in Spring: Using @ControllerAdvice, Assertions, and Enums for Clean Error Management

The article explains how to replace repetitive try‑catch blocks in Java Spring applications with a unified exception handling mechanism that leverages @ControllerAdvice, custom BaseException, Assert utilities, and enum‑based error codes to produce consistent, environment‑aware error responses.

BackendEnumsJava
0 likes · 20 min read
Unified Exception Handling in Spring: Using @ControllerAdvice, Assertions, and Enums for Clean Error Management
Architect's Tech Stack
Architect's Tech Stack
Jul 22, 2023 · Backend Development

Improving Spring MVC Controller Layer: Unified Response Structure, Validation, and Exception Handling

This article explains how to refactor a Spring MVC Controller layer by introducing a unified response format, leveraging ResponseBodyAdvice for automatic wrapping, applying JSR‑303 validation for request parameters, and centralizing exception handling to produce clean, maintainable backend code.

ControllerJavaSpring MVC
0 likes · 17 min read
Improving Spring MVC Controller Layer: Unified Response Structure, Validation, and Exception Handling
Selected Java Interview Questions
Selected Java Interview Questions
Apr 14, 2023 · Backend Development

Improving Spring Controller Layer: Unified Response Structure, Validation, and Exception Handling

This article explains how to refactor a Spring MVC Controller layer by defining its responsibilities, introducing a unified response format, using ResponseBodyAdvice for automatic wrapping, applying JSR‑303 validation for request parameters, and implementing custom exceptions with centralized handling to achieve cleaner, more maintainable backend code.

Controllerexceptionhandlingresponsebodyadvice
0 likes · 17 min read
Improving Spring Controller Layer: Unified Response Structure, Validation, and Exception Handling
Code Ape Tech Column
Code Ape Tech Column
Feb 2, 2023 · Backend Development

Handling Exceptions in Java ThreadPool: submit vs execute and Custom Solutions

This article explains why tasks submitted to a Java ThreadPool via submit do not print exceptions, how to retrieve them using Future.get(), and presents three practical solutions—including try‑catch, Thread.setDefaultUncaughtExceptionHandler, and overriding afterExecute—to reliably capture and process thread pool exceptions.

ExecutorServiceJavaThreadPool
0 likes · 14 min read
Handling Exceptions in Java ThreadPool: submit vs execute and Custom Solutions
Architect's Tech Stack
Architect's Tech Stack
Dec 4, 2022 · Backend Development

Unified Exception Handling in Spring Boot Using @ControllerAdvice, Assert, and Enum‑Based Business Errors

This article explains how to replace repetitive try‑catch blocks in Java Spring applications with a unified exception handling strategy that leverages @ControllerAdvice, custom Assert utilities, enum‑based error codes, and standardized response objects to improve code readability, maintainability, and internationalisation.

AssertJavaMyBatis
0 likes · 21 min read
Unified Exception Handling in Spring Boot Using @ControllerAdvice, Assert, and Enum‑Based Business Errors
Java Captain
Java Captain
Nov 23, 2022 · Backend Development

Best Practices for Designing an Excellent Controller Layer in Spring MVC

The article presents comprehensive best‑practice guidelines for building a clean, maintainable Controller layer in Spring MVC, covering its essential responsibilities, common pitfalls, unified response structures, parameter validation with JSR‑303, custom validators, and centralized exception handling to improve code simplicity and robustness.

BackendControllerJava
0 likes · 19 min read
Best Practices for Designing an Excellent Controller Layer in Spring MVC
Code Ape Tech Column
Code Ape Tech Column
Nov 10, 2022 · Backend Development

Designing an Excellent Controller Layer in Spring MVC

This article explains how to improve the Controller layer in Spring applications by separating responsibilities, implementing unified response structures with Result wrappers, handling String response issues via ResponseBodyAdvice, applying parameter validation with JSR‑303, customizing validators, and centralizing exception handling for cleaner, more maintainable backend code.

ControllerJavaexceptionhandling
0 likes · 18 min read
Designing an Excellent Controller Layer in Spring MVC
Top Architect
Top Architect
Nov 7, 2022 · Backend Development

Improving Spring Controller Layer: Unified Response Structure, Validation, and Exception Handling

This article explains how to refactor Spring MVC Controller code by introducing a unified response format, handling String and JSON return types with ResponseBodyAdvice, applying parameter validation using JSR‑303, and implementing custom exceptions with centralized exception handling to simplify business logic and improve code maintainability.

Controllerexceptionhandlingresponsebodyadvice
0 likes · 20 min read
Improving Spring Controller Layer: Unified Response Structure, Validation, and Exception Handling
Top Architect
Top Architect
Oct 22, 2022 · Backend Development

Unified Exception Handling in Spring Using @ControllerAdvice and Custom Assertions

This article explains how to replace repetitive try‑catch blocks in Spring applications with a unified exception handling mechanism based on @ControllerAdvice, custom assertion utilities, and enum‑driven business exceptions, while also showing how to standardize response structures and integrate internationalization.

ControllerAdviceJavaassertions
0 likes · 11 min read
Unified Exception Handling in Spring Using @ControllerAdvice and Custom Assertions
Selected Java Interview Questions
Selected Java Interview Questions
Oct 11, 2022 · Backend Development

Handling Exceptions in Java Thread Pools: submit vs execute and Custom afterExecute

This article explains why tasks submitted to a Java thread pool via submit do not print exceptions, how to retrieve those exceptions using Future.get, and presents three practical solutions—including try‑catch, Thread.setDefaultUncaughtExceptionHandler, and overriding afterExecute—to reliably capture and process thread‑pool errors.

ExecutorServiceThreadPoolexceptionhandling
0 likes · 14 min read
Handling Exceptions in Java Thread Pools: submit vs execute and Custom afterExecute
Java Backend Technology
Java Backend Technology
Sep 9, 2022 · Backend Development

How to Refactor Spring Controllers for Clean, Unified Responses

This article explains how to improve Spring MVC controller logic by separating responsibilities, introducing a unified response structure, handling String return types with ResponseBodyAdvice, applying JSR‑303 validation, creating custom validators, and using custom exceptions with global exception handling to produce concise and maintainable backend code.

ControllerJavaexceptionhandling
0 likes · 18 min read
How to Refactor Spring Controllers for Clean, Unified Responses
IT Architects Alliance
IT Architects Alliance
Sep 7, 2022 · Backend Development

Improving Spring MVC Controller Logic: Unified Response, Validation, and Exception Handling

This article explains how to refactor Spring MVC controller code by introducing a unified response structure, handling String response issues with ResponseBodyAdvice, applying JSR‑303 validation, creating custom validation annotations, and implementing custom exceptions with global exception handling to produce cleaner, more maintainable backend services.

ControllerJavaexceptionhandling
0 likes · 18 min read
Improving Spring MVC Controller Logic: Unified Response, Validation, and Exception Handling
Top Architect
Top Architect
Aug 28, 2022 · Backend Development

Spring Boot Parameter Validation with javax.validation and Custom Annotations

This tutorial demonstrates how to replace verbose manual checks in Java services with Spring's javax.validation annotation‑based validation, covering built‑in constraints, Maven setup, DTO annotations, validation groups, custom validators, and a global exception handler for unified error responses.

Javaannotationsexceptionhandling
0 likes · 13 min read
Spring Boot Parameter Validation with javax.validation and Custom Annotations
Cognitive Technology Team
Cognitive Technology Team
Jul 23, 2022 · Backend Development

Understanding FutureTask: Features, Implementation, and Common Pitfalls

FutureTask acts as a proxy for asynchronous tasks in Java, providing result retrieval with optional timeout, completion checks, cancellation, and repeat execution, while managing task state, outcomes, and exceptions; the article illustrates usage, internal fields, and common pitfalls such as missed exceptions and indefinite blocking.

AsynchronousFutureTaskJava
0 likes · 5 min read
Understanding FutureTask: Features, Implementation, and Common Pitfalls
Selected Java Interview Questions
Selected Java Interview Questions
Jun 7, 2022 · Backend Development

Unified Parameter Validation, Response Wrapping, and Exception Handling in Spring Boot Controllers

This article explains how to handle controller parameters, implement unified status codes with ResultVo, apply @Validated for request validation, and use @RestControllerAdvice together with ResponseBodyAdvice to automatically wrap responses and centralize exception handling in a Spring Boot backend.

ControllerResponseWrapperSpringBoot
0 likes · 18 min read
Unified Parameter Validation, Response Wrapping, and Exception Handling in Spring Boot Controllers
Programmer DD
Programmer DD
May 28, 2022 · Backend Development

Master Unified Exception Handling in Spring with @ControllerAdvice and Assert

This article explains how to replace repetitive try‑catch blocks in Java Spring applications with a clean, centralized exception handling strategy using @ControllerAdvice, custom Assert utilities, and enum‑based error codes, while also showing how to return consistent error responses across services.

AssertControllerAdviceJava
0 likes · 25 min read
Master Unified Exception Handling in Spring with @ControllerAdvice and Assert
Top Architect
Top Architect
Jul 28, 2021 · Backend Development

SpringBoot Global Exception Handling Tutorial with Custom Error Responses

This article demonstrates how to implement global exception handling in a SpringBoot project, covering environment setup, Maven dependencies, custom error interfaces, enums, exception classes, response wrappers, and controller advice, along with testing via Postman to verify handling of custom, null pointer, and generic exceptions.

GlobalExceptionHandlingJavaSpringBoot
0 likes · 14 min read
SpringBoot Global Exception Handling Tutorial with Custom Error Responses
Top Architect
Top Architect
Apr 13, 2021 · Backend Development

SpringBoot Global Exception Handling Tutorial with Custom Error Codes and Response Wrapper

This article demonstrates how to set up global exception handling in a SpringBoot application by preparing the development environment, adding Maven dependencies, defining a base error interface, custom enums, exception classes, a unified response body, and a controller advice that captures business, null‑pointer, and generic exceptions, followed by testing the implementation with Postman.

GlobalExceptionHandlingJavaSpringBoot
0 likes · 14 min read
SpringBoot Global Exception Handling Tutorial with Custom Error Codes and Response Wrapper
Top Architect
Top Architect
Mar 25, 2021 · Backend Development

Understanding the Working Principle of @ControllerAdvice in Spring MVC

This article explains how the @ControllerAdvice annotation is discovered and utilized within Spring MVC, detailing the initialization process, the caching of @ExceptionHandler, @ModelAttribute, and @InitBinder methods, and how these global configurations are applied by RequestMappingHandlerAdapter during request handling.

BackendControllerAdviceJava
0 likes · 12 min read
Understanding the Working Principle of @ControllerAdvice in Spring MVC
Java Captain
Java Captain
Oct 9, 2020 · Backend Development

Building a Robust Backend API with Spring Boot: Validation, Global Exception Handling, and Unified Response

This article demonstrates how to build a clean Spring Boot backend API by adding the web starter, using Hibernate Validator for parameter checks, handling validation errors with global exception handling, defining custom exceptions, and standardizing responses with a unified ResultVO and response‑code enum.

SpringBootValidatorbackendapi
0 likes · 19 min read
Building a Robust Backend API with Spring Boot: Validation, Global Exception Handling, and Unified Response
Top Architect
Top Architect
Sep 22, 2020 · Backend Development

Implementing Multi-Image Upload and Preview in Spring MVC

This article demonstrates how to implement a merchant registration backend feature that supports uploading multiple images with preview using Spring MVC's MultipartFile, including controller handling, front‑end HTML/JS code, configuration for file size limits, and global exception handling.

FileUploadJavaMultipartFile
0 likes · 7 min read
Implementing Multi-Image Upload and Preview in Spring MVC
Programmer DD
Programmer DD
Aug 21, 2020 · Backend Development

Master Precise Calculations in Java: A Deep Dive into BigDecimal

This article explains Java's BigDecimal class, covering its purpose, constructors, common methods, formatting techniques, handling of non‑terminating division, and best‑practice recommendations, while providing clear code examples and practical tips for accurate high‑precision arithmetic.

ArithmeticBigDecimalNumberFormat
0 likes · 19 min read
Master Precise Calculations in Java: A Deep Dive into BigDecimal
ITFLY8 Architecture Home
ITFLY8 Architecture Home
Mar 8, 2020 · Backend Development

How to Enable and Customize Asynchronous Execution in Spring

Learn how to enable Spring's @Async support, configure custom executors, use @Async with void and Future return types, and implement custom exception handling for uncaught async errors, providing a complete guide to asynchronous method execution in Spring applications.

AsyncExecutorexceptionhandling
0 likes · 4 min read
How to Enable and Customize Asynchronous Execution in Spring
FunTester
FunTester
Sep 22, 2019 · Backend Development

How to Add Automatic Retry to Java HttpClient for Robust API Testing

This guide shows how to create a custom HttpRequestRetryHandler that intelligently retries failed HTTP calls—handling timeouts, connection errors, SSL issues, and idempotent requests—and integrates it into a CloseableHttpClient built with a connection pool and custom request configuration.

BackendConnectionPoolHttpClient
0 likes · 5 min read
How to Add Automatic Retry to Java HttpClient for Robust API Testing
Java Captain
Java Captain
Jul 27, 2019 · Backend Development

Comprehensive Guide to Java Thread Pools: Concepts, Common Interview Questions, and Practical Usage

This article provides an in‑depth overview of Java thread pools, covering core concepts, typical interview questions, creation via ThreadPoolExecutor, execution flow, rejection policies, work‑queue types, common pool implementations, exception handling strategies, and pool state transitions, all illustrated with code examples and diagrams.

ExecutorServiceJavaThreadPool
0 likes · 17 min read
Comprehensive Guide to Java Thread Pools: Concepts, Common Interview Questions, and Practical Usage
Java Captain
Java Captain
Feb 20, 2018 · Fundamentals

Understanding and Proper Use of Checked Exceptions in Java

This article explains Java's exception hierarchy, distinguishes checked from unchecked exceptions, illustrates common pitfalls of overusing throws, and provides best‑practice guidelines for handling, documenting, and wrapping checked exceptions to improve API design and application robustness.

APIDesignBestPracticesCheckedException
0 likes · 14 min read
Understanding and Proper Use of Checked Exceptions in Java
21CTO
21CTO
Nov 30, 2015 · Backend Development

What Makes an API Great? Proven Design Principles from Joshua Bloch

This article explains why APIs are valuable assets, outlines the essential traits of a good API, and provides a step‑by‑step design process—including requirements gathering, naming, documentation, performance considerations, exception handling, and refactoring examples—illustrated with Java code snippets.

APIBestPracticesDesign
0 likes · 14 min read
What Makes an API Great? Proven Design Principles from Joshua Bloch