Tag

ExceptionHandling

1 views collected around this technical thread.

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.

ControllerExceptionHandlingResponseBodyAdvice
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.

AnnotationsExceptionHandlingJava
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.

AOPExceptionHandlingJava
0 likes · 23 min read
Enterprise Java Core Features: Full‑Chain Logging, Unified Exception Handling, Permission Interceptor, and Thread Context Management
Java Architect Essentials
Java Architect Essentials
May 11, 2025 · Backend Development

Simplifying HTTP Response Status Handling in SpringBoot with @ResponseStatus

The article explains how SpringBoot's @ResponseStatus annotation can automatically set HTTP response status codes for methods and custom exceptions, reducing boilerplate code, improving maintainability, and offering flexible error handling, with practical examples and best‑practice guidelines.

@ResponseStatusExceptionHandlingHTTP
0 likes · 7 min read
Simplifying HTTP Response Status Handling in SpringBoot with @ResponseStatus
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.

ControllerExceptionHandlingJava
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.

CustomExceptionExceptionHandlingGlobalException
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.

AsyncCompletableFutureExceptionHandling
0 likes · 10 min read
Common Pitfalls When Using CompletableFuture in Java
Architect
Architect
Jan 10, 2025 · Backend Development

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

The article presents a step‑by‑step guide to refactor Spring MVC controller code by unifying response formats, applying a global response wrapper, enforcing parameter validation with JSR‑303, and handling custom exceptions through a centralized advice, all illustrated with complete Java examples.

ControllerExceptionHandlingJava
0 likes · 18 min read
Refactoring Spring Controller Layer: Unified Response Structure, Validation, and Exception Handling
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.

ControllerExceptionHandlingJava
0 likes · 18 min read
Refactoring Spring MVC Controllers: Unified Return Structure, Response Advice, Parameter Validation, and Global Exception Handling
Java Architect Essentials
Java Architect Essentials
Dec 18, 2024 · Backend Development

Using Java 8 Functional Interfaces to Replace Traditional if…else Branches

This article explains how Java 8’s @FunctionalInterface, together with Supplier, Consumer, Runnable and Function types, can be used to eliminate repetitive if…else statements, handle exceptions, branch logic, and present‑or‑else scenarios, providing cleaner and more expressive backend code.

ExceptionHandlingFunctionalInterfaceJava
0 likes · 8 min read
Using Java 8 Functional Interfaces to Replace Traditional if…else Branches
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.

ControllerExceptionHandlingJava
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.

ControllerExceptionHandlingSpringBoot
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.

AOPExceptionHandlingJava
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.

ExceptionHandlingJavaMaven
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.

ControllerExceptionHandlingJava
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.

AOPExceptionHandlingJava
0 likes · 20 min read
Spring Transaction Pitfalls: Common Scenarios Where Transactions Fail and How to Fix Them
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Sep 5, 2024 · Backend Development

Common SpringBoot BeanCreationException Errors and How to Fix Them

This article explains the most frequent SpringBoot BeanCreationException scenarios—including missing beans, duplicate beans, constructor issues, circular dependencies, and bean overriding—provides clear code examples, and offers practical solutions to resolve each problem.

BeanCreationExceptionDependencyInjectionExceptionHandling
0 likes · 7 min read
Common SpringBoot BeanCreationException Errors 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.

ExceptionHandlingExecutorServiceJava
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.

ControllerExceptionHandlingJava
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.

ControllerExceptionHandlingJava
0 likes · 18 min read
Best Practices for Designing a Robust Controller Layer in Spring Backend Applications