1. Which Spring Framework version first added support for Jackson 3?
Why: Jackson 3 support is only available starting with Spring Framework 7.0. It is not available in any earlier Spring version.
2. What is the minimum Java version required by Jackson 3?
Why: Jackson 3 requires Java 17 or higher.
3. Which message converter class does Spring provide for Jackson 3 JSON conversion?
Why:JacksonJsonHttpMessageConverter is the new converter that works with Jackson 3. MappingJackson2HttpMessageConverter is the older one for Jackson 2.
4. Which Jackson 2 based message converter is deprecated in Spring Framework 7.0?
Why: Spring's Jackson 2 support, which uses MappingJackson2HttpMessageConverter, is deprecated in Spring Framework 7.0 and planned for removal in a future release.
5. What is the Maven groupId used by Jackson 3 libraries?
Why: Jackson 3 uses the new tools.jackson group id. This lets Jackson 2 and Jackson 3 exist on the same classpath without conflict.
6. Why does Jackson 3 use a new Maven groupId and package names?
Why: The new group id allows Jackson 2 and Jackson 3 to coexist on the same classpath without conflict.
7. What is the main design change in Jackson 3 compared to the mutable ObjectMapper of Jackson 2?
Why: Jackson 3 moves to an immutable and thread-safe JsonMapper design, replacing the mutable ObjectMapper used in Jackson 2.
8. What is the simplest way to enable Jackson 3 JSON conversion in Spring MVC?
Why: No explicit configuration is needed. Adding the Jackson 3 jackson-databind dependency to the classpath is enough.
9. How does Spring MVC decide to register the Jackson 3 message converter automatically?
Why: Spring MVC detects the presence of the Jackson 3 JsonMapper class at runtime. If found, it registers JacksonJsonHttpMessageConverter in the default converter list.
10. When do you need to define a message converter explicitly for Jackson 3?
Why: Explicit registration is not needed for default behavior. You only need it if you want to customize the JsonMapper configuration.
11. What does the @RequestBody annotation do when the request has a JSON body?
Why:@RequestBody tells Spring to read the request body and convert it to a Java object using a suitable message converter.
12. What does the @ResponseBody annotation do for a returned Java object?
Why:@ResponseBody makes Spring write the returned object directly to the response body, converted by a message converter (for example, to JSON).
13. Which interface represents the converters that Spring MVC uses to convert request and response bodies?
Why:HttpMessageConverter is the Spring interface for converting HTTP request and response bodies to and from Java objects.
14. Which media type should a request use so that a controller method can read a JSON body?
Why: JSON data is sent with the application/json media type. The matching converter reads the body based on this type.
15. Which @RequestMapping attribute limits a method to requests with a given content type, such as JSON?
Why:consumes restricts the request content type a method accepts. produces restricts the content type of the response.
16. Which @RequestMapping attribute tells Spring that a method returns JSON?
Why:produces defines the media type of the response. Setting it to application/json means the method returns JSON.
17. A JSON array is returned from a controller method as a List<User>. What is converted into JSON?
Why: A Java list is converted into a JSON array, and each element of the list becomes an element in that array.
18. What happens to Jackson 2 support in a future Spring release after the deprecation in Spring Framework 7.0?
Why: Jackson 2 support is deprecated in Spring Framework 7.0. Its removal is currently planned for Spring Framework 7.2.