Closed mmly closed 10 years ago
Did you put your assets in src/main/resources/static
inside your project? You seemed to indicate just /resources/static
. That has to do with how Boot configures view resolvers.
And be sure to confirm everything works BEFORE you turn on security. That way you aren't trying to solve the wrong problem.
Yes I put assets into src/main/resources/static. And yes assets are accessible with turn off spring security, but when spring security is turn on assets are not accessible.
Check the path to your static assets and cross check with http://docs.spring.io/spring-security/site/docs/3.2.4.RELEASE/reference/htmlsingle/#authorize-requests to put right path into permitAll.
I like new spring guides. I clone this repo and using this project as baseline for my new project. Howto access static assets(js, css) from login.html ? My solution: I think that spring boot have automatic acces to /resources/static so I: -created /resources/static folder and put there my static assets(/js /css) -add spring security rule: .antMatchers("/", "/home", "/resources/**").permitAll() but assets aren't accessible and they are protected.