【发布时间】:2019-05-17 20:00:44
【问题描述】:
我无法使用 Spring boot 为我的 Angular 应用程序提供服务。
@RequestMapping("/home")
public String home() {
return "index";
}
文件夹结构
resources > public > index.html
如果我去 localhost:8080/home 我得到这个错误:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing
this as a fallback.
Mon Dec 17 13:30:33 CET 2018
There was an unexpected error (type=Internal Server Error, status=500).
Could not resolve view with name 'index' in servlet with name 'dispatcherServlet'
但是如果我直接去http://localhost:8080/index.html 它确实有效
如果我直接去http://localhost:8080 我会得到:
No mapping for GET /
【问题讨论】:
标签: angular spring-boot