Close
« Tutorial

Spring MVC - Custom HttpMessageConverter MCQ

0/13
0 ✓
0 ✗

1. What is the job of an HttpMessageConverter in Spring MVC?

2. Which part of an HTTP message does an HttpMessageConverter work with?

3. When do you need to create a custom HttpMessageConverter?

4. Which class is a convenient base class for creating a custom message converter?

5. Why is it usually better to extend AbstractHttpMessageConverter than to implement HttpMessageConverter directly?

6. In a class that extends AbstractHttpMessageConverter, which method tells Spring which Java classes the converter can handle?

7. In a class that extends AbstractHttpMessageConverter, which method do you override to read the request body and create a Java object?

8. In a class that extends AbstractHttpMessageConverter, which method do you override to write a Java object to the response body?

9. What do the supported media types of a message converter tell Spring?

10. How does Spring choose a converter to read a request body?

11. Which annotation on a controller method parameter tells Spring to convert the request body into a Java object using a message converter?

12. Which annotation tells Spring to write the return value of a controller method to the response body using a message converter?

13. Which WebMvcConfigurer method is overridden to register a custom message converter?

14. Which attribute of @RequestMapping limits a handler method to requests with a specific Content-Type?

15. What should the supports() method of a custom converter usually check?

Join