This article explains how to protect user privacy in a Java backend by creating a custom @PrivacyEncrypt annotation and a Jackson serializer that automatically mask sensitive fields such as phone numbers, emails, and ID cards during JSON serialization.
This article explains how to protect user privacy by applying data desensitization in a Java backend, using a custom annotation and Jackson serializer to mask sensitive fields such as phone numbers, emails, IDs, and names during JSON serialization.
This article walks through a complete Spring Boot solution for encrypting and decrypting API requests and responses, covering requirement analysis, data models, custom ControllerAdvice implementations, serialization challenges, and practical code examples using AES and Jackson.
Learn three practical methods to protect sensitive API response data in SpringBoot 2.4.12—complete with SQL examples, custom Jackson annotations, and a reusable serializer to automatically mask fields like ID numbers during JSON output.
This article walks through implementing symmetric encryption for both request and response bodies in a Spring MVC project, covering requirement analysis, data model design, custom ControllerAdvice for decryption and encryption, serialization challenges with FastJson and Jackson, and final configuration to ensure consistent API output across Android, iOS, and H5 clients.
This article documents a step‑by‑step solution for preventing XSS attacks in a Spring Boot application, covering input validation, a custom HttpServletRequestWrapper, filter registration, and Jackson serializers/deserializers to escape malicious HTML both on request parameters and JSON payloads.
This article explains how to secure Spring Boot APIs by encrypting request and response bodies with symmetric AES, handling signatures, and configuring Jackson serialization to preserve enum and date formats, providing complete code examples and debugging insights.
This article explains how to protect a Spring Boot application from XSS attacks by validating input, wrapping HttpServletRequest, creating a servlet filter, and customizing Jackson serialization/deserialization to safely handle both form parameters and @RequestBody JSON payloads.
This article presents a JMH‑based performance comparison of four popular Java JSON libraries—Gson, FastJson, Jackson, and Json‑lib—covering their Maven dependencies, utility wrappers, a realistic Person model, serialization and deserialization benchmarks, and analysis of the results to guide library selection.
This article explains how to customize the date format returned by SpringBoot REST controllers using configuration files, Jackson annotations, JavaBean annotations, and global converters, covering both JSON serialization and form data binding with practical code examples.
This article explains a configurable multi‑strategy data‑masking solution for Spring Boot APIs, covering the design of a custom annotation, serializer, AnnotationIntrospector, ObjectMapper integration, and example usage on response objects.
When generating large IDs using Snowflake-like algorithms, Java's 64‑bit long values exceed JavaScript's safe integer range, causing display errors; the article explains how to resolve this by serializing Long values as strings in Spring Boot using Jackson's ToStringSerializer, both via configuration and annotations.
This article explains how to implement a flexible, annotation‑driven data‑masking solution for Java backend services by defining custom masking annotations, serializers, and integrating them into Spring's ObjectMapper to automatically mask sensitive fields in API responses.
This article demonstrates how to create a configurable, multi‑strategy data‑masking solution in Spring Boot by defining custom annotations, serializers, and integrating them with Jackson's ObjectMapper to automatically mask sensitive fields in API responses.
This article demonstrates how to implement a flexible data‑masking solution for sensitive fields in Spring Boot APIs by defining a custom annotation, creating a serializer, integrating it with Jackson via an AnnotationIntrospector, configuring the ObjectMapper, and applying the annotation to domain objects.
This article explains how to create a flexible, annotation‑driven data‑masking solution for Spring Boot APIs by defining custom masking strategies, integrating a Jackson serializer, and configuring the ObjectMapper to automatically mask sensitive fields in response objects.
This article demonstrates how to secure GET and POST API endpoints in a Spring MVC application by encrypting request bodies and responses with AES, using custom ControllerAdvice classes, handling serialization issues with FastJSON and Jackson, and configuring ObjectMapper for proper date and enum formatting.
This article walks through implementing symmetric request and response encryption for Spring Boot APIs—covering requirements, data models, controller examples, debugging serialization issues, and using ControllerAdvice with Jackson to ensure encrypted payloads remain compatible across Android, iOS, and H5 clients.
This article explains how to mask sensitive fields such as ID numbers, phone numbers, and addresses in Java APIs by creating a custom @Sensitive annotation, defining masking strategies, implementing a Jackson serializer, and testing the solution with a Spring REST controller, providing complete code examples and sample output.
This article examines the performance impact of instantiating a new Jackson ObjectMapper for each JSON parsing operation versus reusing a global instance, using JMH micro‑benchmarks to show that a shared ObjectMapper can be up to ten times faster.
This article benchmarks three ObjectMapper usage patterns—creating a new instance per call, sharing a global singleton, and using ThreadLocal—demonstrating that a single shared ObjectMapper can achieve up to ten‑fold higher throughput in JSON parsing.
This article explains how to globally handle LocalDate, LocalDateTime, and LocalTime parameters in Spring Boot 2.x by creating custom Converter beans, configuring Jackson's ObjectMapper, using @DateTimeFormat, ControllerAdvice, and understanding the underlying parameter resolution mechanisms to avoid common pitfalls such as lambda‑based converter registration failures.
This article explains how to globally configure date and time handling in Spring Boot 2.x, covering custom Converter beans for LocalDate, LocalDateTime, and LocalTime, Jackson JSON serialization settings, @InitBinder usage, and common pitfalls such as lambda expressions and parameter binding.
This article demonstrates five practical techniques for reading YAML configuration files in Spring Boot—including Environment, YamlPropertiesFactoryBean, custom listeners, SnakeYml, and Jackson—providing code examples, usage details, and tips for handling defaults and profile activation.
This article explains the difference between shallow and deep copying in Java and provides five practical techniques—including constructor copying, overriding clone(), Apache Commons Lang serialization, Gson serialization, and Jackson serialization—complete with code examples and test cases to demonstrate each approach.
This tutorial explains how Java developers can use Jackson Mixins to add custom JSON serialization and deserialization behavior to classes that lack default constructors or getters, without modifying the original classes, and shows how to register Mixins via ObjectMapper or custom modules.
This article explains how to protect sensitive information in Spring Boot applications by encrypting configuration files with jasypt‑spring‑boot, masking API response fields using a custom Jackson annotation, and filtering log output with a custom Log4j2 PatternLayout, providing complete code examples for each method.
This tutorial explains how to move data desensitization to the JSON serialization stage using Jackson, defines a @Sensitive annotation, custom strategies, a contextual serializer, and demonstrates the approach with a User class example that masks personal fields during serialization.
This article provides a comprehensive guide to using Jackson with Spring Boot, covering its core modules, Maven dependencies, ObjectMapper usage, JSON tree model, custom deserializers, XML handling, configuration options, and practical code examples for serialization and deserialization.
This article evaluates Alibaba's FastJson library by comparing its parsing speed, Maven popularity, and issue count against Jackson and Gson, presenting benchmark results, highlighting a critical bug in timestamp handling, and concluding with a recommendation to prefer Jackson for most Java projects.
This article examines Alibaba's FastJson library, comparing its parsing speed and popularity against Jackson and Gson, presents benchmark results, highlights code defects and unresolved issues, and concludes with recommendations for using Jackson over FastJson in Java backend projects.
This tutorial demonstrates how to use Jackson's ObjectMapper and ObjectNode to programmatically add, modify, and delete fields in JSON strings or Java objects, providing clear code examples and explaining the underlying JsonNode API for flexible JSON manipulation.
This article examines Alibaba's FastJson library, benchmarking its speed against Jackson and Gson, analyzing its limited adoption, exposing unresolved issues, and ultimately recommending a shift to more widely supported JSON parsers for Java projects.
This tutorial walks you through creating a Spring Boot web project, adding the starter dependency, implementing a REST endpoint, customizing Tomcat port and context path, and configuring Jackson for JSON output such as date formatting and global ObjectMapper settings.
This tutorial explains how Spring Boot returns JSON using the default Jackson library, compares it with Alibaba's FastJson, demonstrates handling of null values, and shows how to encapsulate responses in a unified structure with status codes and messages for backend development.
This article explains the high‑severity CVE‑2020‑24616 deserialization flaw in jackson‑databind, identifies affected Jackson and Spring Boot versions, and provides Maven‑based remediation steps such as version pinning, dependency exclusions, and dependencyManagement configuration to prevent remote code execution.
This article examines FastJson’s claim of speed by benchmarking it against Jackson and Gson, analyzes test results, discusses its popularity, highlights critical bugs in its timestamp handling, and ultimately recommends abandoning FastJson in favor of more widely adopted JSON libraries.
The article introduces Alibaba's FastJson library, presents a benchmark showing it is only modestly faster than Jackson, discusses its limited popularity and numerous unresolved issues, and concludes that projects should prefer Jackson and gradually drop FastJson in favor of more reliable JSON parsers.
The article examines Alibaba's FastJson library, presenting performance tests against Jackson and Gson, revealing modest speed gains, low adoption in Maven, numerous unresolved issues, and ultimately recommending developers switch to Jackson for JSON processing in Java projects.
This tutorial explains how Spring Boot automatically configures Jackson's ObjectMapper, shows how to override it with a custom mapper that formats Date fields, and demonstrates both serialization and deserialization of JSON using the customized ObjectMapper in a Spring MVC controller.
This guide explains how Spring Boot automatically configures JSON libraries like Jackson, shows how to add the necessary starter, demonstrates returning JSON objects with @RestController, and illustrates receiving JSON payloads via @RequestBody with complete MockMvc test examples.
Using JMH, this article benchmarks the serialization and deserialization performance of four popular Java JSON libraries—Gson, Fastjson, Jackson, and Json-lib—by testing various scenarios with a complex Person model, analyzing results, and providing guidance on selecting the most suitable library for high‑performance applications.
Learn how to quickly wrap XML requests into objects and return XML responses in Spring Boot by leveraging the HttpMessageConverter mechanism, adding the Jackson XML message converter, defining POJOs with Jackson annotations, and creating controller endpoints that consume and produce XML.
When a Spring Cloud Feign client sends a request containing Java 8 date/time types like LocalDate, LocalTime, or LocalDateTime, the response may trigger JSON parse errors because Spring MVC serializes them as arrays, but Feign expects a proper object, which can be resolved by adding Jackson's JSR‑310 module and configuring the ObjectMapper.
To avoid NullPointerException in Java, use string literals with equals, prefer String.valueOf over toString, employ null‑safe libraries like Apache Commons StringUtils, return empty collections instead of null, annotate with @NotNull/@Nullable, prevent unnecessary autoboxing, define sensible defaults, and use Jackson's path method for safe JSON navigation.