Close
« Tutorial

Spring MVC - Custom Binding with @RequestParam MCQ

0/13
0 ✓
0 ✗

1. What is data binding in Spring MVC when it is used with request parameters?

2. Which annotation is used to customize data binding for a controller?

3. What is the main purpose of a method annotated with @InitBinder?

4. Which parameter type can an @InitBinder method accept to do the customization?

5. What is a PropertyEditor used for in data binding?

6. Which method of WebDataBinder is used to add a custom PropertyEditor for a specific type?

7. Why would you create a custom binding for a @RequestParam value?

8. Spring MVC receives a request parameter as text. What happens before it reaches a handler method argument of type java.util.Date?

9. What does @InitBinder("paramName") do when a name is given in the annotation?

10. What is the scope of an @InitBinder method that is declared inside a controller class?

11. What does CustomDateEditor do?

12. A date editor is created with a date format and an allowEmpty value of true. What does allowEmpty mean?

13. What usually happens if the request text does not match the date format used by the custom editor?

14. Which Java class is commonly used with CustomDateEditor to define the date pattern?

15. Which is a good reason to use @InitBinder instead of writing conversion code inside every handler method?

Join