I am learning spring boot and spring security with angularjs.
previously I use CDN to load angular in my html, everything just fine.
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-route.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-messages.js"></script>
but many people said using bower
is better so I want to give it a try.
I've installed bower, set the diretory to resources/static/bower_components
, install the dependencies, and change the script.
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-messages/angular-messages.js"></script>
but, when I load the html, it said failed 404. When I tried it on the web, Whitelabel Error Page
error occured.
As I know, everything in resources/static
will be publicly available? Why I cannot access it?
--EDIT--
I am trying a solution from Not loading static Resources in Spring boot, Thymeleaf and AngularJs app, but still failed.
@Configuration
public class WebConfig extends WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/bower_components/**")
.addResourceLocations(classpath:"/static/bower_components/");
}
}