Exam 2v0-7222 All QuestionsBrowse all questions from this exam
Question 29

Which three types can be used as @Controller method arguments? (Choose three.)

    Correct Answer: A, B, F

    Three types that can be used as @Controller method arguments are Locale, Principal, and HttpSession. Locale is used to represent the user’s locale settings such as language or country. Principal represents the currently logged/authenticated user, providing access to user identity information. HttpSession represents the user's current HTTP session, allowing you to access session attributes. Language is not a recognized type in the context of Spring MVC controller method arguments, and Request and Session are too general and not specifically tailored for this use.

Discussion
Tolo01Options: ABF

https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-controller/ann-methods/arguments.html

rhuancaOptions: ABF

A, B , F , Locale specify what session users want (depends on location or language) , httpSession is the session we use for client and server, and principal is user authentication

2211094Options: ABF

Correct answer is ABF. Locale - represent use's local such as language or country Principal - represent currently logged/authenticated user HttpSession - represent user's current HTTP Session so request and Session are too general thus why they're not correct and Language is part of Locale, and spring does not know language but locale.

2211094

https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-controller/ann-methods/arguments.html

saJAvaOptions: ABE

correct