Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam 2V0-72.22 topic 1 question 13 discussion

Actual exam question from VMware's 2V0-72.22
Question #: 13
Topic #: 1
[All 2V0-72.22 Questions]

Refer to the exhibit.

Which option is a valid way to retrieve the account id? (Choose the best answer.)

  • A. Add @PathVariable(“id”) String accountId argument to the update() handler method.
  • B. Add @PathVariable long accountId argument to the update() handler method.
  • C. Add @RequestParam long accountId argument to the update() handler method.
  • D. Add @RequestParam(“id”) String accountId argument to the update() handler method.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Azuni
Highly Voted 10 months, 3 weeks ago
Selected Answer: A
A is the correct answer. Please refer to this: https://www.baeldung.com/spring-pathvariable#specifying-the-request-parameter-name
upvoted 5 times
...
2211094
Most Recent 1 week ago
Be careful here, to me this question is one of very tricky question. Answer is B and not A because A forces data type conversion from string to Integer/long.
upvoted 1 times
...
IYONISSIO
11 months ago
The correct option is B. Add @PathVariable long accountId argument to the update() handler method. The @PathVariable annotation is used to bind a path variable from the request URI to a parameter in the handler method. In this case, the path variable is id, and the type is long. This means that the account id will be passed to the update() handler method as a long value
upvoted 2 times
Azuni
10 months, 3 weeks ago
The answer is A. B will only be valid if the parameter name matches the path variable in the the URL.
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
ex Want to SAVE BIG on Certification Exam Prep?
close
ex Unlock All Exams with ExamTopics Pro 75% Off
  • arrow Choose From 1000+ Exams
  • arrow Access to 10 Exams per Month
  • arrow PDF Format Available
  • arrow Inline Discussions
  • arrow No Captcha/Robot Checks
Limited Time Offer
Ends in