Springboot&x2B;角形罐';不要加载索引html
我最近在学习spring boot,我使用angular作为前端。我厌倦了thymeleaf,所以我尝试在没有模块的情况下加载html5(我将html、css和js放入包Springboot&x2B;角形罐';不要加载索引html,html,spring-boot,Html,Spring Boot,我最近在学习spring boot,我使用angular作为前端。我厌倦了thymeleaf,所以我尝试在没有模块的情况下加载html5(我将html、css和js放入包resource/static)。只有在输入特定的URLhttp://localhost:8080/index.html而不是http://localhost:8080/ 如何使用http://localhost:8080/?只需添加一个控制器,在/上提供index.html: @GetMapping("/") public
resource/static
)。只有在输入特定的URLhttp://localhost:8080/index.html
而不是http://localhost:8080/
如何使用
http://localhost:8080/
?只需添加一个控制器,在/
上提供index.html
:
@GetMapping("/")
public String index() {
return "/resources/static/index.html";
}
我的问题是@EnableWebMvc标记在另一个类中,这不允许在访问localhost:8080时从resources/static返回index.html