springboot项目浏览器报错:There was an unexpected error (type=Not Found, status=404).

springboot+thymeleaf项目,运行时页面报错信息如下:

This application has noexplicitmappingfor/error, so you are seeing thisasa fallback.Sat Dec2315:25:59CST2017There was an unexpectederror(type=NotFound, status=404).No message available

有可能出错的原因:

1.没有在pom文件中添加thymeleaf的依赖

2.在浏览器中输入的url不对

url应该是/cotroller map/map

例如以下代码访问地址:http://localhost:8080/hhllow/getUList

@Controller

@RequestMapping(value="/hhllow")

public class UlevelController {

@RequestMapping(value="getUList", method=RequestMethod.GET)

publicStringgetUlevelList() { ………………

return"ulevel/ulevelList";

}

}

3. controller放的目录不对,

应该与application.java在同一级或者下一级

你可能感兴趣的:(springboot项目浏览器报错:There was an unexpected error (type=Not Found, status=404).)