Close
« Tutorial

Spring MVC - @RequestAttribute MCQ

0 of 0 answered ( ✔ 0 | ✘ 0 )

1. What is the main purpose of the @RequestAttribute annotation?

2. Which annotation is used to read a request attribute that was set earlier on the server side?

3. Where do request attributes usually come from?

4. How long does a request attribute stay available?

5. What is the main difference between a request parameter and a request attribute?

6. A client sends the URL http://example.com?id=5. Can @RequestAttribute read the value of id?

7. Which servlet method does Spring use to get the value for a parameter annotated with @RequestAttribute?

8. What is the default value of the required element of @RequestAttribute?

9. What happens when the attribute is missing and required is true?

10. What does the handler method parameter get when the attribute is missing and required is set to false?

11. Which line correctly marks a request attribute named user as optional?

12. Which elements of @RequestAttribute can be used to give the name of the attribute?

13. Why is @RequestAttribute often better than reading the attribute directly from HttpServletRequest?

Join