Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.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
Spring mvc Spring启动:index.html加载问题_Spring Mvc_Spring Boot - Fatal编程技术网

Spring mvc Spring启动:index.html加载问题

Spring mvc Spring启动:index.html加载问题,spring-mvc,spring-boot,Spring Mvc,Spring Boot,我不熟悉Spring boot抱歉我问了个愚蠢的问题 我已经使用SpringBoot制作了API,现在我想用它配置我的“index.htmt”文件。 我无法做到这一点,但我一直无法找到第808号问题 您已经为模板配置了文件夹pages/,但是您使用的是模板/pages/。只需将模板移动到src/main/resources/pages整个问题,文本不需要是链接。请编辑您的问题以删除此问题并添加一个“谢谢”,更正了此问题并进行了此更改“@Bean public InternalResourceVi

我不熟悉Spring boot抱歉我问了个愚蠢的问题 我已经使用SpringBoot制作了API,现在我想用它配置我的“
index.htmt”
文件。 我无法做到这一点,但我一直无法找到第808号问题


您已经为模板配置了文件夹
pages/
,但是您使用的是
模板/pages/
。只需将模板移动到
src/main/resources/pages

整个问题,文本不需要是链接。请编辑您的问题以删除此问题并添加一个“谢谢”,更正了此问题并进行了此更改“@Bean public InternalResourceViewResolver resolver(){InternalResourceViewResolver resolver=new InternalResourceViewResolver();resolver.setPrefix(“/templates/pages/”);resolver.setSuffix(“/templates/pages/index.html”);return resolver;}'没有帮助,因为后缀不正确。您应该将后缀设置为“.html”尝试将te pages文件夹移动到资源-未工作尝试设置uffix(“.html”);-未工作@Bean public InternalResourceViewResolver(){InternalResourceViewResolver=new InternalResourceViewResolver();resolver.setPrefix(“/templates/pages/”);resolver.setuffix(“.html”);返回resolver;}停止,您应该做一件事:将文件夹移动到资源或创建InternalResourceViewResolver(),就像在您的第一条评论中一样,但使用右suffuxyeah,同样的操作没有帮助