作为示例,在static文件夹下放置一个html文件
启动tomcat直接访问是没有问题
如果把controller这样写
不得不说这个报错还是很有误导性
只有这样写
访问接口是没有问题的
加入templates依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
发现这个界面并不是那个粗糙的界面
因为添加了sercurity依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>