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>
posted @ 2019-04-19 09:07  qwer78  阅读(74)  评论(0)    收藏  举报