VMware
Spring Professional Develop
2V0-72.22
Prepare for the 2V0-72.22 exam to validate your skills in Spring Professional development.
192 questions
0 views
Free
Questions 181–190 of 192
Which Spring service is used for dependency injection?
-
A
@Autowired
-
B
@Component
-
C
@Service
-
D
@Controller
Explanation
@Autowired is specifically for dependency injection, while others denote component types.
A company needs to implement caching for performance optimization. Which Spring framework component should they use?
-
A
Spring Security
-
B
Spring Cache
-
C
Spring Batch
-
D
Spring MVC
Explanation
Spring Cache provides caching abstraction, unlike the other options.
What happens when a Spring Boot application encounters an unhandled exception?
-
A
It logs the exception only
-
B
It stops and shuts down
-
C
It sends a default error response
-
D
It automatically retries the request
Explanation
A default error response is sent if unhandled, whereas others do not apply.
Which Spring framework component provides inversion of control?
-
A
Spring IoC Container
-
B
Spring MVC
-
C
Spring REST
-
D
Spring JDBC
Explanation
The IoC Container manages object creation and lifecycle, while the others serve different purposes.
A company needs to handle cross-origin requests. What should they use in Spring?
-
A
Spring Cloud
-
B
CORS configuration
-
C
Spring Security
-
D
Spring Batch
Explanation
CORS configuration allows handling of cross-origin requests, unlike the other options, which focus on different functionalities.
What happens when a bean in Spring is marked as prototype?
-
A
One instance per request
-
B
Single instance per application
-
C
New instance with each request
-
D
Shared instance across sessions
Explanation
Prototype beans create a new instance for each request, differing from singleton and shared instances.
Which service is used to create and manage metrics in Spring Boot applications?
-
A
Spring Actuator
-
B
Spring Validator
-
C
Spring Data
-
D
Spring Security
Explanation
Spring Actuator provides production-ready metrics; others serve different purposes.
A company needs to implement a circuit breaker pattern in its microservices architecture. Which Spring Cloud project should they consider using?
-
A
Spring Cloud Config
-
B
Spring Cloud Eureka
-
C
Spring Cloud Circuit Breaker
-
D
Spring Cloud Gateway
Explanation
Spring Cloud Circuit Breaker specifically implements circuit breaker functionality.
You are configuring Spring Security for a web application. What happens when you set the 'permitAll()' method on a security route?
-
A
Access is restricted to authorized users.
-
B
Only admins can access the route.
-
C
All users can access the route.
-
D
Access is only allowed during business hours.
Explanation
'permitAll()' allows unrestricted access to the specified route.
Which service allows users to manage dependencies in a Spring application?
-
A
Spring Boot Starter
-
B
Spring Data
-
C
Spring AOP
-
D
Spring MVC
Explanation
Spring Boot Starters simplify dependency management for applications, while others focus on specific functionalities.