Tagged articles
parameter-validation
45 articles · Page 1 of 1
This article walks through why manual if‑else checks are cumbersome for API input validation, introduces Java Bean Validation (JSR‑303/349/380) and its implementations, shows how to use @Validated and @Valid annotations in Spring Boot, and demonstrates unified exception handling for clean error responses.
Bean ValidationHibernate ValidatorJava
0 likes · 21 min read

This guide shows how Spring Boot’s built‑in validation (using @Valid, @Validated and Jakarta Validation annotations) can eliminate repetitive if‑statements, handle nested objects, support group validation, and be extended with custom constraint annotations for clean, maintainable request parameter checks.
@ValidCustom AnnotationHibernate Validator
0 likes · 10 min read

This guide covers Spring Boot parameter validation using Bean Validation annotations, demonstrating basic setup with @Valid/@Validated, custom validator creation for phone numbers, group validation for create/update scenarios, global exception handling for MethodArgumentNotValidException and ConstraintViolationException, and best practices like DTO separation and nested object validation.
Bean ValidationException HandlingHibernate Validator
0 likes · 12 min read

This article explains why controllers are essential yet often over‑engineered, identifies common problems such as tangled validation and inconsistent responses, and demonstrates how to unify return structures, handle String conversion, apply JSR‑303 validation, create custom validators, and centralize exception handling using Spring Boot features.
ControllerException HandlingJava
0 likes · 19 min read

This article walks through Spring Boot’s built‑in parameter validation using JSR‑303/JSR‑380, compares @Valid and @Validated, shows how to configure global exception handling, implement group validation, fast‑fail mode, and custom constraints, and demonstrates both controller‑level and service‑level validation with complete code examples.
@Valid@ValidatedHibernate Validator
0 likes · 39 min read

This article explains how Spring Boot leverages JSR‑380 for declarative request validation, walks through the internal processing chain from RequestResponseBodyMethodProcessor to Hibernate Validator, and demonstrates building custom annotations for enum checks and conditional field validation while supporting multilingual error messages.
Custom AnnotationHibernate ValidatorJSR-380
0 likes · 11 min read

This article walks you through six essential validation strategies for Spring Boot applications, from using JSR‑303 annotations and global exception handling to custom validators, validation groups, cross‑field checks, and integrating a Drools rule engine, all illustrated with complete code examples and best‑practice tips.
Custom AnnotationDroolsException Handling
0 likes · 13 min read

A real‑world incident where an unchecked null request parameter caused a full‑table query, massive memory usage and OOM is examined, then Spring Boot’s validation framework—including manual checks, annotation‑driven constraints, nested and group validation, and global exception handling—is demonstrated step‑by‑step with code samples.
BackendException HandlingJava
0 likes · 18 min read

This article outlines a four‑step approach to refactor Spring MVC controllers by unifying response structures, centralizing response wrapping via ResponseBodyAdvice, implementing robust parameter validation with JSR‑303, and handling custom exceptions globally, resulting in cleaner, more maintainable backend code.
ControllerResponseBodyAdviceSpring MVC
0 likes · 18 min read

This guide explains how to use JSR‑303 and Hibernate Validator in Java Spring Boot to perform comprehensive parameter validation, covering basic annotations, global exception handling, group validation, nested object checks, fast‑fail configuration, and custom validation rules, with practical code examples and testing procedures.
Hibernate ValidatorJSR-303Java
0 likes · 15 min read

This article explains how to refactor the Spring MVC Controller layer by standardizing response structures, implementing unified response wrapping via ResponseBodyAdvice, handling String conversion issues, applying JSR‑303 parameter validation, creating custom validation rules, and defining custom exceptions with centralized exception handling to simplify controller code.
ControllerJavaResponseBodyAdvice
0 likes · 17 min read

This article introduces annotation‑based parameter validation in Spring Boot 3, explains built‑in constraints, shows how to use @Valid and @Validated in controllers, and provides multiple practical code snippets—including record types, error handling, collection validation, and return‑value checks—along with screenshots of validation errors.
JavaSpring Bootbackend development
0 likes · 7 min read

This article outlines ten practical guidelines for robust parameter validation in backend Java services, covering enumeration ranges, consistent length constraints, proper use of @NotBlank, synchronizing API documentation, comprehensive annotation usage, request object encapsulation, and the importance of self‑testing and authorization checks.
AnnotationsJavacode review
0 likes · 8 min read

Spring Boot leverages Hibernate Validator to replace repetitive manual checks with declarative annotations on DTO fields, automatically enforcing constraints via @Valid, while a global exception handler formats failures into clear JSON, and advanced features such as validation groups and custom annotations further enhance maintainability and user‑friendly error reporting.
Hibernate ValidatorJavaSpring Boot
0 likes · 9 min read

This article explains why manual if‑statement checks are problematic, introduces Spring Boot's built‑in validation using Hibernate Validator annotations, shows how to handle errors globally, and covers advanced techniques such as group validation and custom constraint annotations for clean, maintainable backend code.
AnnotationsHibernate ValidatorJava
0 likes · 12 min read

This article explains how to process multipart requests that combine JSON data, XML, and file uploads in Spring Boot using @RequestPart, covering backend controller setup, parameter validation, and the corresponding frontend FormData construction with code examples.
@RequestPartJSONSpring Boot
0 likes · 7 min read

This article explains the role of Controllers in Spring Boot, identifies common pitfalls such as duplicated validation and inconsistent responses, and demonstrates how to refactor them using a unified response structure, ResponseBodyAdvice, proper message converter ordering, JSR‑303 validation, custom validators, and centralized exception handling.
ControllerException HandlingResponseBodyAdvice
0 likes · 19 min read

This article explores MyBatis dynamic SQL, shares a real OOM incident caused by missing backend validation, and offers practical tips on parameter checking, balancing reusable and specialized interfaces, and adopting defensive programming to build more reliable Java backend services.
Dynamic SQLJavaMyBatis
0 likes · 12 min read

This article explains why parameter validation is essential in Java web development, compares traditional manual checks with validator libraries, demonstrates practical usage of Bean Validation, Hibernate‑Validator, and Spring Boot starter‑validation, and covers advanced topics such as nested validation, group validation, custom constraints, and the underlying validation mechanism.
BackendCustom AnnotationHibernate Validator
0 likes · 32 min read

This article introduces a powerful Java parameter‑validation library based on Spring Expression Language, explains its features, supported annotations, usage examples, configuration steps, and how to extend it with custom constraints, providing a complete guide for backend developers.
BackendCustom AnnotationsJava
0 likes · 12 min read

This article outlines eleven practical techniques for protecting API endpoints, covering parameter validation, unified response wrapping, XSS escaping, captcha integration, rate limiting, IP whitelisting, sensitive‑word checks, HTTPS adoption, data encryption, and comprehensive risk control measures, each illustrated with concrete code snippets and step‑by‑step workflows.
API SecurityHTTPSXSS protection
0 likes · 18 min read

This article explains how to replace repetitive manual if‑else checks with Spring Boot’s built‑in Bean Validation, demonstrating the use of @Valid, @Validated, custom constraint annotations, group validation, and global exception handling to achieve clean, reusable, and maintainable parameter validation across controllers and services.
Bean ValidationSpring Bootparameter-validation
0 likes · 20 min read

Spring Boot offers several ways to validate request parameters—including the @Valid and @Validated annotations and custom validation annotations—each with its own strengths, allowing developers to enforce data integrity, improve code quality, and enhance user experience across different scenarios.
@Valid@ValidatedCustom Annotation
0 likes · 11 min read

The Nacos 2.3.0 beta release introduces anti‑fragile, configuration‑change, and unified parameter‑validation plugins, adds ability negotiation, lists numerous feature enhancements and bug fixes, and outlines the roadmap toward Nacos 3.0 while highlighting community achievements in the 2023 Open‑Source Summer program.
Ability NegotiationNacosparameter-validation
0 likes · 14 min read

Learn how to implement comprehensive parameter validation in Spring Boot 2.6.12 using JSR‑303 Bean Validation, covering simple checks, validation groups, single‑parameter validation, nested objects, custom utilities, internationalization, and unified AOP‑based handling with practical code examples and configuration steps.
AOPBean ValidationJSR-303
0 likes · 12 min read

Learn how to implement both simple parameter checks and complex business rule validations in SpringBoot by leveraging Bean Validation, creating custom annotations like @UniqueUser and @NotConflictUser, and integrating them seamlessly into controllers to ensure data integrity and reduce boilerplate logic.
Bean ValidationBusiness Rule ValidationCustom Annotations
0 likes · 9 min read

This guide explains ten practical ways to enforce robust parameter validation in Spring Boot applications, covering built‑in annotations, custom constraints, server‑side checks, meaningful error messages, internationalization, validation groups, cross‑field rules, exception handling, testing strategies, and client‑side considerations.
JSR-303JavaSpring Boot
0 likes · 17 min read

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.
API DesignException HandlingSpring Boot
0 likes · 27 min read

This article explains how to use Spring Validation for automatic request parameter checks in Java web applications, covering basic setup, DTO annotations, requestBody and requestParam validation, unified exception handling, and advanced features like group, nested, collection, custom, and fail‑fast validation.
BackendHibernate ValidatorJava
0 likes · 18 min read

This article provides a thorough tutorial on using Spring Validation for request parameter checking, covering simple usage, dependency setup, requestBody and requestParam validation, group and nested validation, collection handling, custom constraints, programmatic validation, fail‑fast mode, and the underlying implementation in Spring MVC and Hibernate Validator.
Hibernate ValidatorJavaSpring Boot
0 likes · 17 min read

This article outlines ten practical methods to secure API data, covering encryption of transmission, digital signing, token authentication, timestamp and nonce replay protection, rate limiting, blacklist/whitelist controls, data masking, and parameter validation, with detailed explanations and implementation steps.
API Securitydata maskingdigital signing
0 likes · 13 min read


ITPUBJul 4, 2022 · Information Security
This article outlines ten practical methods for protecting API data, covering transmission encryption, digital signatures, token authentication, timestamp and nonce mechanisms, rate limiting, blacklist/whitelist controls, data masking, and parameter validation to ensure comprehensive interface security.
API Securitydata maskingdigital-signature
0 likes · 14 min read

The article shows how to integrate JSR‑303 bean validation into Dubbo services by adding the necessary Maven dependencies, annotating parameter classes, enabling validation on provider and consumer, customizing the validation filter to return a unified FacadeResult, disabling the default filter, and extending validation with custom annotations for clean, maintainable RPC parameter checks.
Custom FilterDubboFacadeResult
0 likes · 18 min read

This article explains how to cleanly perform parameter validation in Java backend applications by placing business‑independent checks in the Controller layer with Hibernate Validator and optional custom annotations, while business‑related checks belong to the Service layer.
ControllerHibernate ValidatorJava
0 likes · 6 min read

This article explains how to perform elegant parameter validation in Spring Boot by distinguishing controller‑level and service‑level checks, introduces Hibernate Validator annotations, demonstrates their usage with code examples, and shows additional utilities like commons‑lang3 and custom validation annotations for robust backend development.
ControllerHibernate ValidatorJava
0 likes · 6 min read

This article explains how to place parameter validation in the appropriate Spring layer, demonstrates using Hibernate Validator and commons‑lang3 for concise validation annotations, provides code examples for entity definitions and controller methods, and mentions creating custom validation annotations when needed.
Commons Lang3ControllerHibernate Validator
0 likes · 6 min read

This article explains how to place parameter validation in the appropriate layer, introduces Hibernate Validator with Maven dependencies and common annotations, provides a validated entity example, shows controller usage with @Valid/@Validated, and demonstrates useful Commons‑Lang3 utilities for string and collection checks.
Commons Lang3Hibernate ValidatorJava
0 likes · 5 min read

This article examines the challenges of repetitive if‑else parameter checks, introduces Hibernate Validator as a JSR‑303 implementation, demonstrates how to build a reusable validation module, and shares best‑practice patterns for integrating elegant, decoupled validation into Java backend systems.
Hibernate ValidatorJSR-303backend development
0 likes · 10 min read

The article demonstrates how to create a custom @ValidShop annotation and an AOP aspect that intercepts Spring MVC controller methods, extracts the annotated parameter via reflection, validates the shop code through a helper service, and proceeds only when the check succeeds.
AOPCustom AnnotationJava
0 likes · 6 min read

This article explains how to use the javax.validation (JSR‑303) annotation‑based validation framework in Spring Boot to replace verbose manual checks, covering built‑in constraints, Maven dependencies, DTO annotations, custom validators, validation groups, global exception handling, and practical RESTful examples.
JavaSpring Bootjavax.validation
0 likes · 16 min read

This article demonstrates how to construct a well‑structured Spring Boot backend API by integrating request validation with Hibernate Validator, implementing global exception handling, defining custom exceptions, and standardizing responses using a unified response object and response‑body advice.
Exception HandlingSpring BootUnified Response
0 likes · 18 min read

This article demonstrates step‑by‑step how to construct a clean and standardized backend API in Spring Boot by introducing required dependencies, using Validator for request parameter checks, applying global exception handling, defining custom exceptions, and implementing a unified response format for both success and error cases.
Global Exception HandlingJavaSpring Boot
0 likes · 20 min read

This article demonstrates how to create a reusable, method‑level parameter validation mechanism in SpringBoot using custom @Check annotations, covering the motivation, usage examples, Maven dependencies, annotation definition, core AOP logic, validation algorithm, and future enhancements.
AOPCustom AnnotationSpringBoot
0 likes · 9 min read

This article explains how to simplify Spring service method parameter checks by encapsulating inputs in POJOs, applying bean‑validation annotations, and using a custom AOP aspect or standard @AssertTrue to automatically enforce validation logic.
AOPBean ValidationSpring
0 likes · 6 min read

This article outlines practical techniques for enhancing Java service robustness, covering standardized response structures, thorough parameter validation, retry strategies, idempotent design, and functional programming with lambdas to reduce runtime errors and improve maintainability.
IdempotencyJavaSpring
0 likes · 5 min read
