Tagged articles
396 articles
Page 3 of 4
Meituan Technology Team
Meituan Technology Team
Jul 6, 2023 · Databases

Meituan Database Attack‑Defense Practice: Kernel Observability, Full SQL, and Index Optimization

The article details how Meituan built a MySQL autonomous platform by constructing kernel observability to split OnCPU/OffCPU wait time, capturing full SQL directly from the kernel with compression, designing a safe exception‑handling workflow, and generating cost‑based index‑tuning suggestions—including what‑if analysis and workload‑driven recommendations—to enable comprehensive SQL governance.

Exception HandlingFull‑SQLIndex Tuning
0 likes · 34 min read
Meituan Database Attack‑Defense Practice: Kernel Observability, Full SQL, and Index Optimization
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jun 15, 2023 · Backend Development

Mastering Spring MVC Exception Handling: From DispatcherServlet to Custom Resolvers

This article explains how Spring MVC handles exceptions, detailing the role of DispatcherServlet, the chain of HandlerExceptionResolver implementations, the controller invocation flow, and the internal mechanisms that resolve errors, including fallback to the default /error endpoint.

Backend DevelopmentDispatcherServletException Handling
0 likes · 8 min read
Mastering Spring MVC Exception Handling: From DispatcherServlet to Custom Resolvers
Efficient Ops
Efficient Ops
Jun 13, 2023 · Operations

How to Automate Batch Job Retries and Eliminate Midnight Outages

This article explores a real‑world scenario where a support manager faces nightly batch job interruptions, analyzes common database and environment failures, and presents a systematic redesign of the batch framework and executor to enable automatic retry, reducing manual intervention and improving operational reliability.

Batch ProcessingException Handlingmysql
0 likes · 7 min read
How to Automate Batch Job Retries and Eliminate Midnight Outages
macrozheng
macrozheng
May 30, 2023 · Backend Development

Mastering Java Exception Handling: From Basics to Advanced Practices

This article explores Java's exception hierarchy, demonstrates proper use of try‑catch‑finally and return statements, shows how to define custom system, business, and third‑party exceptions, implements global handling with @RestControllerAdvice, and discusses monitoring and alerting strategies for robust backend development.

Custom ExceptionsException HandlingJava
0 likes · 15 min read
Mastering Java Exception Handling: From Basics to Advanced Practices
Java Architect Essentials
Java Architect Essentials
May 14, 2023 · Backend Development

Comprehensive Guide to Spring Boot Backend API Design: Validation, Global Exception Handling, Unified Response, Version Control, and Security

This article presents a step‑by‑step tutorial on building robust Spring Boot backend APIs, covering environment setup, parameter validation techniques, global exception handling, unified response structures, optional response wrapping, API versioning via path or header, and comprehensive security measures such as token authentication, timestamp checks, request signing, replay protection, and HTTPS.

APIException HandlingSecurity
0 likes · 26 min read
Comprehensive Guide to Spring Boot Backend API Design: Validation, Global Exception Handling, Unified Response, Version Control, and Security
Top Architect
Top Architect
May 9, 2023 · Backend Development

Unified User Login Permission Validation, Exception Handling, and Response Formatting in Spring Boot

This article demonstrates how to consolidate user login permission checks, exception handling, and unified JSON response structures in a Spring Boot application by using AOP, custom HandlerInterceptor, @ControllerAdvice, and ResponseBodyAdvice, providing complete code examples and implementation details.

Exception HandlingInterceptorJava
0 likes · 21 min read
Unified User Login Permission Validation, Exception Handling, and Response Formatting in Spring Boot
Architect
Architect
May 3, 2023 · Backend Development

Comprehensive Guide to Backend API Design with Spring Boot: Validation, Global Exception Handling, Unified Responses, Versioning, and Security

This article provides a step‑by‑step tutorial on building robust Spring Boot backend APIs, covering environment setup, parameter validation techniques, global exception handling, unified response structures, API version control, and security measures such as token authentication, timestamp checks, URL signing, replay protection, and HTTPS.

Exception HandlingParameter ValidationSpring Boot
0 likes · 27 min read
Comprehensive Guide to Backend API Design with Spring Boot: Validation, Global Exception Handling, Unified Responses, Versioning, and Security
Code Ape Tech Column
Code Ape Tech Column
May 1, 2023 · Backend Development

Comprehensive Guide to Backend API Development with Spring Boot: Validation, Global Exception Handling, Unified Responses, Versioning, and Security

This article provides a detailed tutorial on building robust Spring Boot backend APIs, covering interface structure, environment setup, parameter validation methods, custom validators, global exception handling, unified response formats, optional response wrapping, API version control, and security measures such as token authentication and request signing.

Backend APIException HandlingSpring Boot
0 likes · 27 min read
Comprehensive Guide to Backend API Development with Spring Boot: Validation, Global Exception Handling, Unified Responses, Versioning, and Security
Su San Talks Tech
Su San Talks Tech
Apr 26, 2023 · Fundamentals

How to Replace Cluttered if…else… with Java 8 Functional Interfaces

This article explains how to eliminate repetitive if‑else statements in Java by leveraging Java 8's functional interfaces such as Supplier, Consumer, Runnable, and Function, providing reusable lambda‑based utilities for exception handling and branch processing with clear code examples.

Exception HandlingFunctional InterfaceJava
0 likes · 6 min read
How to Replace Cluttered if…else… with Java 8 Functional Interfaces
IT Xianyu
IT Xianyu
Apr 24, 2023 · Backend Development

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

This article explains how to refactor a Spring MVC Controller by introducing a unified response wrapper, leveraging ResponseBodyAdvice for automatic packaging, applying JSR‑303 validation for @RequestBody, @PathVariable and @RequestParam parameters, creating custom validation annotations, and handling business and system exceptions consistently.

ControllerException HandlingJava
0 likes · 15 min read
Improving Spring Controller Layer: Unified Response Structure, Validation, and Exception Handling
JD Tech
JD Tech
Apr 21, 2023 · Fundamentals

Elegant Java Programming Practices: Code Style, Guard Clauses, Streams, and More

This article shares practical Java coding guidelines—including guard clauses, effective use of Stream API, avoiding nested loops, designing APIs with @see/@link, refined logging, exception handling, custom Spring Boot banners, syntax sugar, chain programming, thread pausing, and tuple usage—to help developers write cleaner, more maintainable code.

Exception HandlingSpring BootStream API
0 likes · 12 min read
Elegant Java Programming Practices: Code Style, Guard Clauses, Streams, and More
Java Backend Technology
Java Backend Technology
Apr 13, 2023 · Backend Development

Mastering Unified Exception Handling in Spring Boot: Clean Code, Better Errors

This article explains how to replace scattered try‑catch blocks in Java services with a clean, unified exception handling approach using Spring’s @ControllerAdvice, custom Assert interfaces, enum‑based error codes, and standardized response objects to improve readability, maintainability, and internationalized error reporting.

AssertException HandlingJava
0 likes · 21 min read
Mastering Unified Exception Handling in Spring Boot: Clean Code, Better Errors
Architect's Guide
Architect's Guide
Apr 4, 2023 · Backend Development

Implementing Unified User Login, Exception Handling, and Data Response in Spring Boot with AOP and Interceptors

This article demonstrates how to use Spring Boot AOP and HandlerInterceptor to create a unified user login permission check, standardized exception handling with @ControllerAdvice, and consistent JSON response formatting, providing step‑by‑step code examples and configuration details for building robust backend services.

Exception HandlingInterceptorSpring Boot
0 likes · 19 min read
Implementing Unified User Login, Exception Handling, and Data Response in Spring Boot with AOP and Interceptors
Top Architect
Top Architect
Mar 22, 2023 · Backend Development

Implementing Unified User Login Validation, Exception Handling, and Data Return Format in Spring Boot

This article demonstrates how to consolidate user login verification, exception handling, and response formatting in a Spring Boot application by using AOP, HandlerInterceptor, @ControllerAdvice, and ResponseBodyAdvice, providing complete code examples and explaining the underlying request processing flow.

Backend DevelopmentException HandlingInterceptor
0 likes · 20 min read
Implementing Unified User Login Validation, Exception Handling, and Data Return Format in Spring Boot
Wukong Talks Architecture
Wukong Talks Architecture
Mar 21, 2023 · Backend Development

Understanding Java Exception Handling: Classification, Bytecode Analysis, Best Practices, and Custom Exceptions

This article provides a comprehensive guide to Java exception handling, covering exception categories, bytecode‑level mechanisms, common pitfalls, Alibaba’s coding standards, best‑practice recommendations, custom exception design, and global handling strategies for RPC and HTTP services in Spring Boot.

Custom ExceptionsException HandlingJava
0 likes · 29 min read
Understanding Java Exception Handling: Classification, Bytecode Analysis, Best Practices, and Custom Exceptions
Alibaba Cloud Developer
Alibaba Cloud Developer
Mar 20, 2023 · Backend Development

Master Java Exception Handling: Best Practices, Bytecode Insights & Custom Exceptions

This comprehensive guide explores Java's exception handling mechanisms, classifies checked and unchecked exceptions, delves into bytecode analysis of try‑catch‑finally and try‑with‑resources, showcases common pitfalls, presents custom exception design patterns, and demonstrates global exception handling for RPC and HTTP layers in Spring Boot applications.

Custom ExceptionsException HandlingSpring Boot
0 likes · 32 min read
Master Java Exception Handling: Best Practices, Bytecode Insights & Custom Exceptions
Architect's Guide
Architect's Guide
Mar 19, 2023 · Backend Development

Implementing Unified Functionality in Spring Boot: Authentication, Data Formatting, Exception Handling, and Interceptors

This article demonstrates how to build a unified processing module in Spring Boot by using AOP and HandlerInterceptor to centralize user login validation, standardize response formats, handle exceptions globally with @ControllerAdvice, and configure path prefixes, providing complete code examples and implementation details.

BackendException HandlingInterceptor
0 likes · 17 min read
Implementing Unified Functionality in Spring Boot: Authentication, Data Formatting, Exception Handling, and Interceptors
Java High-Performance Architecture
Java High-Performance Architecture
Mar 17, 2023 · Backend Development

Master Unified Login, Exception, and Response Handling in Spring Boot with AOP and Interceptors

This article walks through building a Spring Boot application that centralizes user login verification, exception handling, and response formatting by leveraging AOP, custom HandlerInterceptors, @ControllerAdvice, and ResponseBodyAdvice to create clean, maintainable backend code.

Exception HandlingInterceptorSpring Boot
0 likes · 20 min read
Master Unified Login, Exception, and Response Handling in Spring Boot with AOP and Interceptors
Selected Java Interview Questions
Selected Java Interview Questions
Mar 4, 2023 · Backend Development

Analyzing the Performance Impact of try-catch in Java

This article investigates the common belief that using try-catch in Java severely degrades performance by examining JVM exception handling, bytecode generation, compilation optimizations, and extensive benchmark tests, ultimately showing that the overhead is negligible in most scenarios.

BenchmarkException HandlingJVM
0 likes · 16 min read
Analyzing the Performance Impact of try-catch in Java
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Feb 23, 2023 · Backend Development

Mastering Spring MVC Exception Handling: A Deep Dive into HandlerExceptionResolver

This article explains how Spring MVC processes exceptions using the DispatcherServlet and a configurable HandlerExceptionResolver chain, outlines the built‑in resolver implementations, shows how to customize error pages, and provides code examples for handling errors in both HTML and JSON responses.

Backend DevelopmentException HandlingHandlerExceptionResolver
0 likes · 8 min read
Mastering Spring MVC Exception Handling: A Deep Dive into HandlerExceptionResolver
Architect
Architect
Jan 30, 2023 · Backend Development

Unified Exception Monitoring and Reporting with ASM and JavaAgent

This article explains how to use Java bytecode instrumentation with ASM and a JavaAgent to automatically monitor, capture, and report exceptions across a backend system, covering exception fundamentals, best‑practice handling, and practical implementation steps.

ASMException HandlingJava
0 likes · 14 min read
Unified Exception Monitoring and Reporting with ASM and JavaAgent
Su San Talks Tech
Su San Talks Tech
Jan 27, 2023 · Backend Development

Mastering Unified Responses and Exception Handling in Spring Boot Controllers

This article walks through building a robust Spring Boot controller layer by standardizing parameter binding, status codes, response wrapping, validation, and exception handling using annotations, enums, ResultVo, ResponseBodyAdvice, and custom exception advice to deliver consistent API responses.

BackendControllerException Handling
0 likes · 20 min read
Mastering Unified Responses and Exception Handling in Spring Boot Controllers
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Jan 16, 2023 · Backend Development

Comprehensive Guide to Java Exception Handling

This article explains Java exception handling in depth, covering definitions, classification of errors and exceptions, the key keywords (try, catch, finally, throw, throws), practical code examples for try‑catch, try‑catch‑finally, try‑finally, try‑with‑resources, and a set of best‑practice recommendations for writing robust backend code.

BackendException HandlingJava
0 likes · 11 min read
Comprehensive Guide to Java Exception Handling
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jan 16, 2023 · Backend Development

Master Spring MVC Exception Handling: Local, Global, and REST API Strategies

This article explains how to use @ExceptionHandler with @Controller, @ControllerAdvice, and @RestControllerAdvice for local and global exception handling in Spring MVC, details supported method parameters and return types, and shows how to customize REST API error responses by extending ResponseEntityExceptionHandler.

Backend DevelopmentControllerAdviceException Handling
0 likes · 10 min read
Master Spring MVC Exception Handling: Local, Global, and REST API Strategies
DeWu Technology
DeWu Technology
Jan 6, 2023 · Backend Development

Coding Standards and Best Practices for Backend Development

The guide defines backend coding standards and best practices, specifying clear naming conventions for classes, methods, variables and constants, enforcing consistent code style via .editorconfig, recommending unchecked exceptions for simpler error handling, promoting structured asynchronous logging with trace IDs, and outlining performance optimizations such as loop refinement, CompletableFuture concurrency, and proper resource management to prevent memory leaks.

Backend DevelopmentException Handlingbest practices
0 likes · 16 min read
Coding Standards and Best Practices for Backend Development
Java Backend Technology
Java Backend Technology
Dec 24, 2022 · Backend Development

How to Replace Cluttered if…else… with Java 8 Functional Interfaces

This article explains how Java 8's @FunctionalInterface and its built‑in functional types (Supplier, Consumer, Runnable, Function) can be used to eliminate repetitive if…else… statements, with concrete code examples for exception handling, branch processing, and optional value handling.

Branch ProcessingException HandlingFunctional Interface
0 likes · 8 min read
How to Replace Cluttered if…else… with Java 8 Functional Interfaces
Top Architect
Top Architect
Dec 21, 2022 · Backend Development

Refactoring the Spring Boot Controller Layer for Clean Architecture and Unified Responses

This article explains why the Controller layer should stay thin, identifies common pitfalls such as tangled validation and inconsistent responses, and demonstrates how to introduce a unified result wrapper, global response advice, robust parameter validation, custom validators, and centralized exception handling to produce concise, maintainable backend code.

ControllerException HandlingJava
0 likes · 17 min read
Refactoring the Spring Boot Controller Layer for Clean Architecture and Unified Responses
Top Architect
Top Architect
Dec 8, 2022 · Backend Development

Unified Exception Handling in Spring Boot: Best Practices and Implementation

This article explains how to replace repetitive try‑catch blocks with a unified exception handling approach in Spring Boot using @ControllerAdvice, @ExceptionHandler, custom Assert utilities, and enumerated error codes, providing clean code, consistent error responses, and easy internationalization.

AssertException HandlingJava
0 likes · 21 min read
Unified Exception Handling in Spring Boot: Best Practices and Implementation
Top Architect
Top Architect
Dec 2, 2022 · Backend Development

Unified Exception Handling in Spring Boot with Custom Assertions and Enum‑Based Error Codes

This article explains how to implement a comprehensive unified exception handling mechanism in Spring Boot by using @ControllerAdvice, custom BaseException/BusinessException classes, enum‑based error codes, assertion utilities, and standardized response objects to simplify error management across controller and service layers.

EnumsException HandlingJava
0 likes · 22 min read
Unified Exception Handling in Spring Boot with Custom Assertions and Enum‑Based Error Codes
Cognitive Technology Team
Cognitive Technology Team
Oct 16, 2022 · Backend Development

Understanding ScheduledThreadPoolExecutor: Task Types, Configuration, and Common Pitfalls

This article explains the different delay and periodic task types supported by Java's ScheduledThreadPoolExecutor, details its constructor parameters and default settings, and highlights common pitfalls such as exception loss, inaccurate scheduling, and improper core pool size configuration.

Exception HandlingJavaScheduledThreadPoolExecutor
0 likes · 5 min read
Understanding ScheduledThreadPoolExecutor: Task Types, Configuration, and Common Pitfalls
Selected Java Interview Questions
Selected Java Interview Questions
Oct 8, 2022 · Backend Development

Improved NullPointerException Handling in Java 14 (JEP 358)

The article explains how Java 14 introduces enhanced NullPointerException messages via JEP 358, showing traditional NPE problems, the new detailed exception output, required JVM flags, performance considerations, and potential security implications, with code examples illustrating the improvements.

Exception HandlingJEP 358java14
0 likes · 7 min read
Improved NullPointerException Handling in Java 14 (JEP 358)
Architect
Architect
Sep 26, 2022 · Backend Development

Does Using try‑catch in Java Significantly Impact Performance? An In‑Depth JVM Analysis

This article investigates the common belief that Java's try‑catch blocks severely degrade performance by examining JVM exception handling mechanisms, analyzing compiled bytecode, and presenting extensive benchmark tests under various JVM compilation modes to determine the real impact of exception handling on execution speed.

BenchmarkException HandlingJIT
0 likes · 16 min read
Does Using try‑catch in Java Significantly Impact Performance? An In‑Depth JVM Analysis
Top Architect
Top Architect
Sep 11, 2022 · Backend Development

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

This article explains how to design a clean Controller layer in Spring MVC by implementing unified response structures, handling String response issues with ResponseBodyAdvice, applying parameter validation with JSR‑303, and creating custom exceptions with centralized exception handling to simplify business logic.

ControllerException HandlingJava
0 likes · 19 min read
Improving Controller Layer Logic: Unified Response Wrapping, Validation, and Exception Handling in Spring MVC
Sohu Tech Products
Sohu Tech Products
Sep 7, 2022 · Fundamentals

Understanding Mach Tasks, Threads, Processes and Exception Handling on iOS/macOS

The article explains how iOS/macOS uses the XNU kernel's Mach micro‑kernel to represent processes, tasks and threads, describes the relationship between them, classifies hardware and software exceptions, shows how Mach exceptions are translated into Unix signals, and provides practical code examples for capturing both Mach exceptions and signals in a crash‑reporting framework.

Crash ReportingException HandlingMach
0 likes · 28 min read
Understanding Mach Tasks, Threads, Processes and Exception Handling on iOS/macOS
Java Architect Essentials
Java Architect Essentials
Aug 30, 2022 · Backend Development

Mastering Retry Logic in Java: Spring‑Retry vs Guava‑Retry

This article explains how to implement robust retry mechanisms in Java applications by comparing Spring‑Retry's declarative exception‑based approach with Guava‑Retry's flexible result‑oriented strategy, covering dependencies, configuration, policies, back‑off options, annotation usage, and practical code examples.

Backoff StrategyException HandlingGuava Retry
0 likes · 14 min read
Mastering Retry Logic in Java: Spring‑Retry vs Guava‑Retry
Programmer DD
Programmer DD
Aug 29, 2022 · Backend Development

Does Java’s try‑catch Really Slow Down Your Code? A Deep Dive into JVM Performance

This article investigates the common belief that Java try‑catch blocks severely degrade performance by examining JVM exception handling mechanics, compiled bytecode, tiered and JIT compilation, and extensive benchmark tests, ultimately showing that try‑catch has negligible impact when no exception occurs.

BenchmarkException HandlingJVM
0 likes · 18 min read
Does Java’s try‑catch Really Slow Down Your Code? A Deep Dive into JVM Performance
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Aug 24, 2022 · Information Security

Mastering Custom Exception Handling in Spring Security (Spring Boot 2.4)

This guide explains how Spring Security processes authentication and authorization failures, walks through the default exception flow, and demonstrates multiple ways to customize error handling—including custom failure handlers, access‑denied pages, and JSON responses—using Spring Boot 2.4.12.

AuthenticationAuthorizationException Handling
0 likes · 12 min read
Mastering Custom Exception Handling in Spring Security (Spring Boot 2.4)
Java High-Performance Architecture
Java High-Performance Architecture
Aug 14, 2022 · Backend Development

Master Unified Responses, Validation, and Exception Handling in Spring Boot Controllers

This article explains how to structure Spring Boot controller requests, apply elegant parameter validation, wrap responses with a consistent ResultVo format, handle validation and business exceptions uniformly using @RestControllerAdvice, and selectively disable wrapping for specific endpoints, providing a complete backend development guide.

ControllerException HandlingJava
0 likes · 21 min read
Master Unified Responses, Validation, and Exception Handling in Spring Boot Controllers
Top Architect
Top Architect
Aug 10, 2022 · Backend Development

Understanding Spring @Transactional Rollback Behavior and Exception Handling

This article demonstrates how Spring's @Transactional annotation rolls back transactions only for RuntimeException subclasses, shows practical MySQL update tests that trigger ArithmeticException, and explains how to configure rollback for checked exceptions using rollbackFor, with complete code examples.

Exception HandlingJavamysql
0 likes · 5 min read
Understanding Spring @Transactional Rollback Behavior and Exception Handling
Python Programming Learning Circle
Python Programming Learning Circle
Jul 22, 2022 · Fundamentals

Techniques for Exiting Nested Loops in Python

This article explains several methods to break out of nested loops in Python, including using identical break conditions, flag variables, raising exceptions, combining else clauses, and leveraging function returns, illustrated with a prime-number game example and complete code snippets.

Exception HandlingLoopsPython
0 likes · 6 min read
Techniques for Exiting Nested Loops in Python
Selected Java Interview Questions
Selected Java Interview Questions
Jul 17, 2022 · Backend Development

Unified Global Response and Exception Handling in Spring Boot

This article explains how to implement a unified response format and centralized exception handling in Spring Boot applications using @RestControllerAdvice, @ControllerAdvice, ResponseBodyAdvice, and custom response entities, providing code examples and best‑practice guidelines for robust backend APIs.

Exception HandlingGlobal ResponseRestControllerAdvice
0 likes · 13 min read
Unified Global Response and Exception Handling in Spring Boot
Cognitive Technology Team
Cognitive Technology Team
Jul 13, 2022 · Backend Development

ThreadPoolExecutor Hook Methods beforeExecute and afterExecute Must Not Throw Exceptions, Otherwise Threads Exit

The article explains that overriding ThreadPoolExecutor's beforeExecute and afterExecute hooks requires handling any exceptions internally, because uncaught exceptions cause the worker thread to terminate, reducing pool size and preventing proper reuse, and such errors are not logged by default.

Backend DevelopmentException HandlingJava
0 likes · 4 min read
ThreadPoolExecutor Hook Methods beforeExecute and afterExecute Must Not Throw Exceptions, Otherwise Threads Exit
Selected Java Interview Questions
Selected Java Interview Questions
Jul 9, 2022 · Backend Development

Best Practices for Handling Exceptions in Java

This article explains essential Java exception‑handling techniques, including cleaning resources in finally blocks or using try‑with‑resources, declaring specific exceptions, documenting throws clauses, providing descriptive messages, catching the most specific exceptions first, avoiding catching Throwable, not ignoring exceptions, and correctly wrapping exceptions without losing original causes.

Backend DevelopmentException Handlingbest practices
0 likes · 9 min read
Best Practices for Handling Exceptions in Java
Top Architect
Top Architect
Jul 2, 2022 · Backend Development

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

This article explains how to structure Spring Boot controller methods to receive parameters, implement unified status codes, validation with @Validated, and automatic response wrapping using ResultVo and @RestControllerAdvice, while also providing custom exception handling and optional exclusion annotations for flexible API design.

ControllerException HandlingJava
0 likes · 19 min read
Unified Parameter Handling, Validation, and Response Wrapping in Spring Boot Controllers
macrozheng
macrozheng
Jul 1, 2022 · Backend Development

Mastering Spring Boot Controllers: Unified Validation, Response, and Exception Handling

This tutorial explains how to structure a Spring Boot controller layer, validate request parameters with @Validated, wrap responses in a standard ResultVo format, define unified status codes, and handle exceptions globally using @RestControllerAdvice and AOP, while also providing a way to skip wrapping for specific endpoints.

ControllerException HandlingJava
0 likes · 18 min read
Mastering Spring Boot Controllers: Unified Validation, Response, and Exception Handling
Java Architect Essentials
Java Architect Essentials
Jun 26, 2022 · Backend Development

Unified Controller Layer Handling, Validation, and Exception Management in Spring Boot

This article explains how to structure a Spring Boot controller layer by separating URL, request method, request data, and response data, then introduces unified status‑code packaging with ResultVo, parameter validation using @Validated, and centralized exception handling with @RestControllerAdvice and AOP to produce consistent API responses.

ControllerException HandlingResultVo
0 likes · 18 min read
Unified Controller Layer Handling, Validation, and Exception Management in Spring Boot
Java High-Performance Architecture
Java High-Performance Architecture
Jun 16, 2022 · Backend Development

Mastering Custom Exception Handling in Spring Boot: A Complete Guide

This article walks through Spring Boot's default error mapping, shows how to return JSON for AJAX requests and HTML pages for browsers, and provides step‑by‑step code for creating custom exception classes, an error response entity, a Freemarker error template, and a global @ControllerAdvice handler with detailed configuration and testing examples.

Exception HandlingGlobal ExceptionJava
0 likes · 15 min read
Mastering Custom Exception Handling in Spring Boot: A Complete Guide
Java Architect Essentials
Java Architect Essentials
Jun 13, 2022 · Backend Development

Using Java 8 Functional Interfaces to Replace if…else Statements

This article explains how to eliminate repetitive if…else code in Java by leveraging Java 8's functional interfaces such as Function, Supplier, Consumer, and Runnable, providing concrete interface definitions and usage examples for exception handling, branch processing, and present‑or‑else logic.

Branch ProcessingException HandlingFunctional Interface
0 likes · 7 min read
Using Java 8 Functional Interfaces to Replace if…else Statements
Cognitive Technology Team
Cognitive Technology Team
May 9, 2022 · Backend Development

Proper Ways to Close Resources in Java

The article explains best practices for safely closing resources in Java, including using finally blocks, null checks, separate try‑catch for each resource, avoiding return or System.exit in finally, not throwing exceptions from finally, and preferring try‑with‑resources with code examples.

Exception HandlingJavabest practices
0 likes · 3 min read
Proper Ways to Close Resources in Java
Programmer DD
Programmer DD
May 5, 2022 · Backend Development

Master Spring Retry: Using @Retryable for Elegant Failure Handling

This guide explains how Spring Boot’s @Retryable annotation enables elegant, annotation‑driven retry logic, covering dependency setup, enabling retry, method annotation with configurable parameters, recovery handling via @Recover, and important AOP‑related considerations to avoid common pitfalls.

Exception HandlingJavaRetryable
0 likes · 7 min read
Master Spring Retry: Using @Retryable for Elegant Failure Handling
Programmer DD
Programmer DD
Apr 17, 2022 · Backend Development

How to Throw Exceptions Elegantly in Spring Boot Using IntelliJ IDEA

This article explains why and how to deliberately throw exceptions during Spring Boot development to test transaction rollbacks and global error handling, comparing a manual approach with IntelliJ IDEA's built‑in "Throw Exception" debugging feature.

DebuggingException HandlingIntelliJ IDEA
0 likes · 5 min read
How to Throw Exceptions Elegantly in Spring Boot Using IntelliJ IDEA
Selected Java Interview Questions
Selected Java Interview Questions
Apr 16, 2022 · Backend Development

Implementing a Global Unified Exception Handler in Spring Boot

This article demonstrates how to create a reusable global exception handling mechanism for Spring Boot applications by defining a unified response class, custom business exception, error enumeration, and a @RestControllerAdvice handler, complete with code examples and testing guidance.

Exception HandlingGlobal ExceptionSpring Boot
0 likes · 6 min read
Implementing a Global Unified Exception Handler in Spring Boot
Java Backend Technology
Java Backend Technology
Apr 16, 2022 · Backend Development

Why @Transactional Sometimes Fails in Spring and How to Fix It

This article explains three common situations where Spring's @Transactional annotation becomes ineffective—non‑public methods, internal self‑calls, and swallowed exceptions—detailing the underlying proxy mechanism, code examples, test results, and practical workarounds to ensure proper transaction management.

Exception HandlingJavaaop
0 likes · 12 min read
Why @Transactional Sometimes Fails in Spring and How to Fix It
Java High-Performance Architecture
Java High-Performance Architecture
Apr 15, 2022 · Backend Development

Mastering Global Exception Handling in Spring Boot

This guide explains why excessive try‑catch blocks hurt Spring Boot projects, introduces a unified response class, custom business exception, error enumeration, and a global @RestControllerAdvice handler, providing clean, reusable error handling with sample code and test usage.

Backend DevelopmentException HandlingJava
0 likes · 7 min read
Mastering Global Exception Handling in Spring Boot
macrozheng
macrozheng
Mar 10, 2022 · Backend Development

Master Spring Annotations: @Component vs @Bean, @Autowired vs @Resource, @ControllerAdvice

This article explains several often‑confused Spring annotations—including the differences between @Component and @Bean, the injection behaviors of @Autowired versus @Resource, the roles of @Component, @Repository, @Service, and @Controller, the purpose of @Configuration and @ControllerAdvice, and provides practical code examples for each.

Exception HandlingJavaannotations
0 likes · 11 min read
Master Spring Annotations: @Component vs @Bean, @Autowired vs @Resource, @ControllerAdvice
IT Architects Alliance
IT Architects Alliance
Mar 3, 2022 · Backend Development

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

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

AssertControllerAdviceException Handling
0 likes · 20 min read
Unified Exception Handling in Spring Using @ControllerAdvice, Assertions, and Enums
Top Architect
Top Architect
Mar 2, 2022 · Backend Development

Unified Exception Handling in Spring Boot Using @ControllerAdvice, Assert, and Enum‑Based Error Codes

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, and enum‑driven error codes to produce clean, maintainable backend code and consistent error responses.

AssertException HandlingJava
0 likes · 20 min read
Unified Exception Handling in Spring Boot Using @ControllerAdvice, Assert, and Enum‑Based Error Codes
Python Programming Learning Circle
Python Programming Learning Circle
Jan 24, 2022 · Fundamentals

Techniques to Exit Nested Loops in Python

This article explains several Python techniques—using identical break conditions, flag variables, exceptions, loop‑else clauses, and function returns—to exit nested loops, demonstrated through a prime‑number game where the program stops when a non‑prime input is entered.

Exception HandlingLoopsPython
0 likes · 6 min read
Techniques to Exit Nested Loops in Python
Top Architect
Top Architect
Jan 14, 2022 · Backend Development

Understanding Exception Types and @Transactional Usage in Spring

This article explains Java exception classification, distinguishes checked and unchecked exceptions, and demonstrates how to configure Spring's @Transactional annotation to control rollback behavior, including examples of rollbackFor, notRollbackFor, and propagation settings, while highlighting common pitfalls with try‑catch blocks.

Backend DevelopmentException HandlingJava
0 likes · 5 min read
Understanding Exception Types and @Transactional Usage in Spring
Java Backend Technology
Java Backend Technology
Dec 16, 2021 · Backend Development

Eliminate if…else Chaos in Java 8 with Functional Interfaces

Learn how to replace repetitive if…else statements in Java by leveraging Java 8’s functional interfaces—Supplier, Consumer, Runnable, and Function—through clear examples, custom interfaces, and utility methods that streamline exception handling, branch processing, and null checks for cleaner, more maintainable code.

Code RefactoringException HandlingFunctional Interface
0 likes · 6 min read
Eliminate if…else Chaos in Java 8 with Functional Interfaces
Code Ape Tech Column
Code Ape Tech Column
Dec 9, 2021 · Information Security

Customizing Exception Responses in Spring Security OAuth2

This article explains how to customize authentication and resource server exception messages in Spring Security OAuth2, covering the creation of custom translators, entry points, and filters, with step‑by‑step code examples and testing procedures for handling username/password errors, grant type errors, client credential errors, token expiration, and insufficient permissions.

AuthenticationBackendException Handling
0 likes · 10 min read
Customizing Exception Responses in Spring Security OAuth2
Selected Java Interview Questions
Selected Java Interview Questions
Dec 4, 2021 · Backend Development

Common Scenarios Where Spring @Transactional Does Not Take Effect

This article explains eight typical situations—such as using non‑transactional storage engines, missing Spring bean registration, non‑public methods, self‑invocation, absent transaction manager, incorrect propagation settings, swallowed exceptions, and wrong exception types—that cause the @Transactional annotation in Spring to appear ineffective, and provides practical solutions for each.

BackendException HandlingJava
0 likes · 7 min read
Common Scenarios Where Spring @Transactional Does Not Take Effect
Liangxu Linux
Liangxu Linux
Nov 21, 2021 · Fundamentals

Why Interrupts Matter: Unraveling CPU Interrupt Mechanisms and the IDT

This article explains how CPUs receive interrupt numbers through hardware, exceptions, or the INT instruction, describes the structure and purpose of the Interrupt Descriptor Table, and details the stack operations and control‑flow steps the processor performs to handle and return from an interrupt.

CPUException HandlingIDT
0 likes · 17 min read
Why Interrupts Matter: Unraveling CPU Interrupt Mechanisms and the IDT
Architect's Journey
Architect's Journey
Nov 12, 2021 · Backend Development

Common Feign Pitfalls and How to Solve Them

This article examines three frequent challenges when using Feign in Spring Cloud—where to place the client, whether to wrap Feign interfaces, and how to handle business exceptions—offering a detailed comparison of two call styles, a ResponseBodyAdvice‑based wrapper solution, and a custom error decoder to propagate original exceptions.

Backend DevelopmentException HandlingSpring Cloud
0 likes · 13 min read
Common Feign Pitfalls and How to Solve Them
Yang Money Pot Technology Team
Yang Money Pot Technology Team
Oct 26, 2021 · Mobile Development

Encapsulating Retrofit with Kotlin Coroutines in Android: Two Approaches

This article explains how to combine Retrofit with Kotlin coroutines on Android, compares the traditional RxJava method with coroutine-based implementations, and presents two encapsulation techniques—using a DSL and leveraging CoroutineExceptionHandler—to simplify asynchronous network calls and centralize error handling.

AndroidCoroutinesDSL
0 likes · 14 min read
Encapsulating Retrofit with Kotlin Coroutines in Android: Two Approaches
Python Programming Learning Circle
Python Programming Learning Circle
Oct 23, 2021 · Backend Development

Using Loguru for Simplified and Powerful Python Logging

This article introduces the Loguru library as an elegant, concise alternative to Python's built‑in logging, demonstrating installation, basic usage, file configuration, formatting, filtering, rotation, retention, compression, serialization, and advanced exception tracing with code examples.

Exception HandlingLogurulogging
0 likes · 17 min read
Using Loguru for Simplified and Powerful Python Logging
Java Architect Essentials
Java Architect Essentials
Sep 21, 2021 · Fundamentals

Coding Standards and Best Practices for Robust Software Development

This article presents a set of coding "military rules" covering topics such as avoiding magic numbers, limiting method parameters, proper resource release, specific exception handling, and precise arithmetic, followed by practical development efficiency tips and resource links for further learning.

Exception HandlingResource ManagementSoftware Engineering
0 likes · 9 min read
Coding Standards and Best Practices for Robust Software Development
macrozheng
macrozheng
Aug 30, 2021 · Backend Development

Master Spring Boot Parameter Validation: Custom Rules, Group Checks, and Global Error Handling

This tutorial explains why parameter validation is essential in Spring Boot APIs, shows how to integrate the JSR‑303 Validator, demonstrates custom annotations, group validation, and simplifies error responses with a global exception handler, providing complete code examples for each step.

Custom AnnotationException HandlingGroup Validation
0 likes · 17 min read
Master Spring Boot Parameter Validation: Custom Rules, Group Checks, and Global Error Handling
NetEase Cloud Music Tech Team
NetEase Cloud Music Tech Team
Aug 16, 2021 · Fundamentals

Java and Kotlin Exception Handling Best Practices

To improve Java‑Kotlin interoperability, the article recommends treating Kotlin exceptions as unchecked while enforcing Java‑style checked‑exception discipline through lint checks, using specific custom exceptions, avoiding broad catches or throws of Throwable, logging via a Monitor, and never returning from finally blocks to reduce crashes.

Checked ExceptionException HandlingJava
0 likes · 9 min read
Java and Kotlin Exception Handling Best Practices
macrozheng
macrozheng
Aug 4, 2021 · Backend Development

Master Global Exception Handling in Spring Boot with @ControllerAdvice

This article explains how to use Spring Boot's @ControllerAdvice and @ExceptionHandler annotations to implement clean, global exception handling, covering basic usage, controller‑specific handlers, and ordered advice for multiple handlers, with practical code examples and diagrams.

Backend DevelopmentControllerAdviceException Handling
0 likes · 7 min read
Master Global Exception Handling in Spring Boot with @ControllerAdvice
Selected Java Interview Questions
Selected Java Interview Questions
Jul 23, 2021 · Backend Development

Global Exception Handling in Spring MVC Using @ControllerAdvice and @ExceptionHandler

This article explains why global exception handling is needed in Spring MVC, outlines its application scenarios, compares AOP with the simpler @ControllerAdvice/@ExceptionHandler approach, and provides detailed code examples for custom response objects, validation handling, and transaction rollback strategies to improve code cleanliness and maintainability.

BackendControllerAdviceException Handling
0 likes · 11 min read
Global Exception Handling in Spring MVC Using @ControllerAdvice and @ExceptionHandler
Programmer DD
Programmer DD
Jul 9, 2021 · Backend Development

Why Catching an Exception Doesn't Prevent Spring Transaction Rollback

This article explains why a caught javax.validation.ConstraintViolationException in a Spring @Transactional method does not stop the transaction from rolling back, and shows how to debug the flow with logs and breakpoints to understand the underlying commit process.

DebuggingException HandlingJava
0 likes · 4 min read
Why Catching an Exception Doesn't Prevent Spring Transaction Rollback
Top Architect
Top Architect
Jul 4, 2021 · Fundamentals

Avoiding Null Checks in Java: Assertions, Exceptions, and the Null Object Pattern

This article explains how to distinguish between valid and invalid null returns in Java, recommends using assertions or exceptions for erroneous nulls, suggests returning empty collections or objects, and demonstrates the Null Object pattern with code examples to eliminate repetitive null‑pointer checks.

Exception HandlingJavaNull Object pattern
0 likes · 6 min read
Avoiding Null Checks in Java: Assertions, Exceptions, and the Null Object Pattern
Programmer DD
Programmer DD
Jun 24, 2021 · Backend Development

Master Java Exception Handling: 10 Best Practices Every Developer Should Follow

This article presents ten essential Java exception‑handling best practices—including proper resource cleanup, using specific exception types, documenting throws clauses, providing clear messages, catching the most specific exceptions first, avoiding Throwable, logging wisely, and preserving original causes—to improve code readability, reliability, and maintainability.

BackendException HandlingJava
0 likes · 10 min read
Master Java Exception Handling: 10 Best Practices Every Developer Should Follow
Top Architect
Top Architect
Jun 21, 2021 · Backend Development

Custom Global Exception Handling in Spring Boot

This article explains how to configure Spring Boot to handle default and custom exceptions globally, covering logging of error mappings, adding Fastjson and Freemarker dependencies, configuring properties, defining error entity and custom exception classes, creating an error template, implementing a @ControllerAdvice handler, and testing with sample controllers and JSON responses.

ControllerAdviceException HandlingGlobal Exception
0 likes · 13 min read
Custom Global Exception Handling in Spring Boot
Code Ape Tech Column
Code Ape Tech Column
Jun 15, 2021 · Backend Development

How to Build Robust, High‑Concurrency APIs: Design, Security, and Scaling Tips

This article outlines practical guidelines for designing and implementing enterprise‑grade APIs, covering request/response definitions, unified error handling, interceptor chains, token‑based authentication, rate limiting, load balancing, clustering, caching, and strategies for achieving high concurrency and high availability.

Exception Handlingapi-designhigh concurrency
0 likes · 18 min read
How to Build Robust, High‑Concurrency APIs: Design, Security, and Scaling Tips
Programmer DD
Programmer DD
Jun 5, 2021 · Backend Development

When Does @Transactional Roll Back? Mastering Spring Transaction Exceptions

This article explains Alibaba’s Java guidelines for using @Transactional, categorizes checked and unchecked exceptions, shows how Spring’s default rollback behavior works, and provides practical examples of configuring rollback rules, avoiding common pitfalls, and best practices for applying @Transactional in backend Java applications.

Backend DevelopmentException HandlingJava
0 likes · 5 min read
When Does @Transactional Roll Back? Mastering Spring Transaction Exceptions
KooFE Frontend Team
KooFE Frontend Team
May 25, 2021 · Frontend Development

Why Ignoring Exceptions Is Killing Your JavaScript Code (And How to Fix It)

This article explains why proper exception handling is essential for high‑quality JavaScript, contrasts using return codes with real exceptions, shows clean versus dirty code examples, and offers practical guidelines such as defining custom exception hierarchies, handling Promise rejections, and providing contextual error information.

Exception HandlingJavaScriptcode quality
0 likes · 10 min read
Why Ignoring Exceptions Is Killing Your JavaScript Code (And How to Fix It)
Top Architect
Top Architect
May 17, 2021 · Backend Development

Common Spring Transaction Failure Scenarios and Their Solutions

This article explains typical situations where Spring @Transactional annotations fail—such as non‑public methods, beans not managed by the container, internal method calls, non‑RuntimeException throws, caught exceptions without rethrow, incorrect propagation settings, and unsupported MyISAM storage—and provides concrete code examples and fixes to ensure proper transaction behavior.

Exception HandlingJavaaop
0 likes · 10 min read
Common Spring Transaction Failure Scenarios and Their Solutions
Top Architect
Top Architect
May 7, 2021 · Backend Development

Common Spring Transaction Failure Scenarios and Their Solutions

This article explains typical reasons why @Transactional may not work in Spring applications—such as non‑public methods, beans not managed by the container, internal method calls, non‑RuntimeException throws, swallowed exceptions, wrong propagation settings, and unsupported MySQL storage engines—and provides concrete code examples and fixes for each case.

Exception HandlingJavaaop
0 likes · 11 min read
Common Spring Transaction Failure Scenarios and Their Solutions
Selected Java Interview Questions
Selected Java Interview Questions
May 4, 2021 · Backend Development

Building a Reusable Backend Base Project with Swagger, CodeGenerator, Pagination, Exception Handling, and Multi‑Environment Configuration

This article explains how to create a reusable backend foundation for new Spring Boot projects by assembling common utilities such as Swagger API documentation, MyBatis‑Plus code generation, unified response objects, pagination helpers, custom exception handling, multi‑environment Maven and Spring profiles, logback configuration, and a Jenkins pipeline.

BackendException HandlingJava
0 likes · 15 min read
Building a Reusable Backend Base Project with Swagger, CodeGenerator, Pagination, Exception Handling, and Multi‑Environment Configuration
Top Architect
Top Architect
May 4, 2021 · Backend Development

Best Practices for Exception Handling in Java

This article outlines essential Java exception‑handling best practices, covering resource cleanup with finally or try‑with‑resources, declaring specific exceptions, documenting throws clauses, providing descriptive messages, catching the most specific exceptions first, avoiding catching Throwable, never ignoring or double‑logging exceptions, and correctly wrapping exceptions without losing the original cause.

Exception HandlingJavabest practices
0 likes · 11 min read
Best Practices for Exception Handling in Java
Python Programming Learning Circle
Python Programming Learning Circle
Apr 22, 2021 · Fundamentals

Advanced Class Methods and Special Member Functions in Python

This article explains Python's advanced class features—including static methods, class methods, property decorators, special dunder methods, reflection utilities, dynamic attribute manipulation, metaclass creation, and exception handling—illustrated with clear code examples and practical usage tips.

Exception HandlingPropertyReflection
0 likes · 14 min read
Advanced Class Methods and Special Member Functions in Python
Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Apr 22, 2021 · Backend Development

Prevent Log Injection in Log4j2: Clean Input, PatternLayout, and Custom Throwable Converter

This article explains how malicious newline characters in logged usernames can cause log injection, demonstrates a simple input‑sanitizing method, shows how to use Log4j2's %enc{%m}{CRLF} pattern and a custom ThrowablePatternConverter to ensure all log messages and exception stacks remain on a single safe line.

Exception HandlingSecuritylog injection
0 likes · 8 min read
Prevent Log Injection in Log4j2: Clean Input, PatternLayout, and Custom Throwable Converter
Selected Java Interview Questions
Selected Java Interview Questions
Apr 14, 2021 · Backend Development

Avoiding Null Checks in Java: When to Use Assertions, Exceptions, and the Null Object Pattern

This article explains why excessive null‑checking in Java code is problematic, distinguishes valid versus invalid null returns, and presents better alternatives such as assertions, throwing exceptions, returning empty collections or objects, and applying the Null Object pattern with concrete code examples.

Exception HandlingJavaNull Object pattern
0 likes · 6 min read
Avoiding Null Checks in Java: When to Use Assertions, Exceptions, and the Null Object Pattern
Senior Brother's Insights
Senior Brother's Insights
Apr 11, 2021 · Backend Development

Why Try-with-Resources Outperforms Try-Catch-Finally in Java

Java developers often close resources manually using try-catch-finally, but since JDK 7 the try‑with‑resources construct automates this process; this article explains the traditional pattern, demonstrates the new syntax, shows how to implement custom Closeable classes, and reveals the compiler‑generated bytecode that preserves original exceptions via addSuppressed.

CloseableException HandlingJDK7
0 likes · 10 min read
Why Try-with-Resources Outperforms Try-Catch-Finally in Java