springboot报模板找不到错误

org.thymeleaf.exceptions.TemplateInputException: Error resolving template “user/login”, template might not exist or might not be accessible by any of the configured Template Resolvers…

1.配置

spring.thymeleaf.cache=false
spring.thymeleaf.servlet.content-type=text/html
spring.thymeleaf.enabled=true
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.mode=HTML
spring.thymeleaf.prefix = classpath:/templates/
spring.thymeleaf.suffix = .html

2.request

@RequestMapping(value = "/403", method = RequestMethod.GET)
	public String forbidden() {
		return "error/403";//前面务必没有/
	}

3.pom build添加

		<resources>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
		</resources>
发布了97 篇原创文章 · 获赞 44 · 访问量 30万+

猜你喜欢

转载自blog.csdn.net/wangh92/article/details/89392853
今日推荐