Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Springboot&x2B;角形罐';不要加载索引html_Html_Spring Boot - Fatal编程技术网

Springboot&x2B;角形罐';不要加载索引html

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

我最近在学习spring boot,我使用angular作为前端。我厌倦了thymeleaf,所以我尝试在没有模块的情况下加载html5(我将html、css和js放入包
resource/static
)。只有在输入特定的URL
http://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