In a Spring Boot application, how can you prevent a controller method from being exposed over HTTP?
- Configuring it in the application.properties file.
- Placing the controller class in a specific package.
- There is no way to prevent a controller method from being exposed over HTTP in Spring Boot.
- Using the @NoHttpExpose annotation.
To prevent a controller method from being exposed over HTTP in a Spring Boot application, you can configure it in the application.properties file by setting the appropriate properties. Using the @NoHttpExpose annotation is not a standard Spring Boot feature. Placing the controller class in a specific package does not control HTTP exposure. However, by default, only the controllers in the same or sub-packages of the main application class are scanned and exposed over HTTP.
Loading...
Related Quiz
- The order in which auto-configurations are applied in Spring Boot can be influenced using the _____ property.
- To test interactions with the database in isolation, Spring Boot provides the _____ annotation, which disables full auto-configuration and applies only JPA-related configurations.
- The Spring Cloud component _____ provides a simple, scalable, and flexible way to route API requests to microservices.
- In a Spring Boot test, how can you override the properties defined in the application.properties file?
- To enable method-level security in Spring Security, the _____ annotation must be added to the configuration class.