2V0-72-22 practice question 2 of 15

Which two options will inject the value of the daily.limit system property? (Choose two.)

Full set: 79 questions
Answer options
A:

A. @Value(“#{daily.limit}”)

B:

B. @Value(“$(systemProperties.daily.limit)”)

C:

C. @Value(“$(daily.limit)”)

D:

D. @Value(“#{systemProperties[‘daily.limit’]}”)

Correct answer
E:

E. @Value(“#{systemProperties.daily.limit}”)

Correct answer
Correct Answer:
D. D. @Value(“#{systemProperties[‘daily.limit’]}”); E. E. @Value(“#{systemProperties.daily.limit}”)
Explanation

In Spring Framework, system properties are accessed through SpEL (Spring Expression Language) using the systemProperties predefined variable. The correct syntax requires using #{} for SpEL expressions. Option D uses the bracket notation systemProperties['daily.limit'] while option E uses dot notation systemProperties.daily.limit. Both are valid SpEL syntax for accessing system properties. The ${} syntax in options B and C is used for property placeholders, not for accessing system properties through SpEL.

Why Incorrect

A. Uses SpEL syntax but missing the systemProperties reference needed to access system properties.
B. Uses property placeholder syntax $() instead of SpEL syntax #{} for systemProperties.
C. Uses property placeholder syntax which resolves properties files, not system properties.

References

1. Spring Framework Reference Documentation 5.3.x, Section 4.3.2 "SpEL Evaluation", subsection on "Variables and Functions"

2. VMware Spring Professional Develop (2V0-72.22) Official Courseware, Module 3: "Configuration", pages 3-15 to 3-18

3. Spring Framework API Documentation, org.springframework.beans.factory.annotation.Value JavaDoc

4. "Pro Spring 5" by Iuliana Cosmina et al., Apress, Chapter 4 "Spring Configuration", pp. 142-145

5. Spring Framework Reference Documentation 5.3.x, Section 2.2.3 "Property Source Abstraction"

Scroll to Top