How can you restrict access to specific HTTP methods in Spring Security?
- By using @RequestMapping annotations
- By defining custom HTTP headers
- By using Java annotations like @Secured or @PreAuthorize
- By configuring the httpMethod attribute in security rules
In Spring Security, you can restrict access to specific HTTP methods by configuring the httpMethod attribute within security rules. This allows you to specify which HTTP methods are allowed or denied for a particular URL pattern. The other options are not used to restrict access to HTTP methods in Spring Security, but rather for other purposes, such as defining mappings or custom headers.
Loading...
Related Quiz
- What does the @ConditionalOnClass annotation do in the context of Auto Configuration?
- To handle an exception thrown by a specific method in a controller, the _____ annotation is used on a method within that controller.
- In connection pooling, what does the term "Maximum Pool Size" refer to?
- In Spring Boot, how do you configure the TestRestTemplate to work with a specific profile during integration testing?
- How do you ensure fault tolerance and resilience in microservices developed with Spring Cloud?