access static content in secured Spring Boot application

前端 未结 1 471
长发绾君心
长发绾君心 2020-12-15 10:55

I have a standalone Spring Boot application with templates in /src/main/resources/templates and static content in /src/main/resources/static. I would like the static content

相关标签:
1条回答
  • 2020-12-15 11:52

    The static content in classpath:/static is served at the root of the application (i.e. /*), whether or not the application is secure, so you need to match on specific paths underneath the root. Spring Boot permits all access by default to /js/**, /css/**, /images/** (see SpringBootWebSecurityConfiguration for details), but you may have switched that off (can't see the rest of your code).

    0 讨论(0)
提交回复
热议问题