Close
« Tutorial

Spring MVC - HttpMessageConverter for CSV MCQ

0/13
0 ✓
0 ✗

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

2. Why would you create a custom HttpMessageConverter for a format like CSV?

3. Which base class can you extend to make writing a custom converter easier?

4. Which method of AbstractHttpMessageConverter do you override to say which Java types the converter can handle?

5. Which method of AbstractHttpMessageConverter do you override to turn the request body into a Java object?

6. Which method of AbstractHttpMessageConverter do you override to turn a Java object into the response body?

7. How does a custom converter tell Spring which content type it supports?

8. Which request header does Spring use to pick a converter for reading the request body?

9. Which request header does Spring use to pick a converter for writing the response body?

10. Which annotation tells Spring to convert the request body into a method parameter using a message converter?

11. Which annotation makes Spring write a method's return value directly to the response body using a message converter?

12. Which attribute of @PostMapping or @GetMapping limits a handler method to requests with a given body content type?

13. Which attribute of a mapping annotation declares the content type that a handler method returns?

14. What do you need to do after writing a custom HttpMessageConverter?

15. Which interface do you implement in a Java configuration class to register custom message converters?

16. What does Spring do if no registered converter can handle the content type of a request body?

17. A third-party library is often used inside a CSV converter. What is the main reason?

18. A converter must handle many different bean types, such as a list of employees or a list of products. What is a good way to design it?

Join