I'm using this link to configure security and spring-boot as base for other. But static resource handler provided by spring-boot is executed before security settings. So if I send POST request, static content handler respond me that method POST not supported. If I request GET method, static response handler catch it and try to find resourse. So any requests catched by static content handler and not go to security filters.
How can I disable static content filters/handlers provided by spring-boot?
Using Spring BootSpring Boot comes with a pre-configured implementation of ResourceHttpRequestHandler to facilitate serving static resources. By default, this handler serves static content from any of the /static, /public, /resources, and /META-INF/resources directories that are on the classpath.
Create a static file final. Update the Spring configuration file HelloWeb-servlet. xml under the WebContent/WEB-INF folder as shown below. The final step is to create the content of the source and configuration files and export the application, which is explained below.
You can disable the static resource handling by setting spring.resources.add-mappings=false
in your application.properties
.
With that out of the way, are you sure that it will resolve your problem? Spring Security runs as a filter before the static resource handling and I doubt that disabling the resource handling will help. Perhaps it'll make it easier to identify the underlying problem, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With