springboot整合thymeleaf始终无法显示页面,求高人支招

springboot整合thymeleaf始终无法显示页面,求高人支招。

pom.xml配置



	4.0.0

	com.ran.learn
	demo
	
	war

	demo
	Demo project for Spring Boot

	
		org.springframework.boot
		spring-boot-starter-parent
		2.0.1.RELEASE
		 
	

	
		UTF-8
		UTF-8
		1.8
		${basedir}/../..
	

	
		
			org.springframework.boot
			spring-boot-starter
		

		
			org.springframework.boot
			spring-boot-starter-test
			test
		
		
		
		
			org.springframework.boot
			spring-boot-starter-web
		
		
			org.springframework.boot
			spring-boot-configuration-processor
			true
		
		
		
	    
	    	
	        
	        org.springframework.boot
			spring-boot-starter-thymeleaf
		
	    
	     
	

	
		
			
				org.springframework.boot
				spring-boot-maven-plugin
			
		
	




Handler类

@Controller
@RequestMapping(value="/users")
public class UserController {
	@RequestMapping(value="/page/all")
	public String userListPage() {
return "test";
	}

}

工程结构

springboot整合thymeleaf始终无法显示页面,求高人支招_第1张图片


test.html内容





Insert title here


这里是templates的的的

访问地址:

http://localhost:8080/users/page/all

结果:

程序可以正常导出debug到controller方法里,但是无法显示test.html,始终显示如下:

springboot整合thymeleaf始终无法显示页面,求高人支招_第2张图片


我上边用的springboot版本是:

2.0.1.RELEASE

如果我换成1.5版本的springboot就可以正常运行,不知道为什么,求高人指点!谢谢,谢谢,两天了,没找到原理,网上,各种方法都试了。基本用的都是1.5左右的springboot,我说的是2.0.1的版本,怎样做,才能正常运行。












你可能感兴趣的:(spring,spring-boot,thymeleaf)