2v0-7222 Exam QuestionsBrowse all questions from this exam

2v0-7222 Exam - Question 29


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

Show Answer
Correct Answer: ABEF

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

5 comments
Sign in to comment
Tolo01Options: ABF
Jul 28, 2023

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

rhuancaOptions: ABF
Apr 2, 2023

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

saJAvaOptions: ABE
Jun 10, 2024

correct

2211094
Jun 14, 2024

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

2211094Options: ABF
Jun 14, 2024

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.