我正在尝试使用 thymeleaf,因为它在所有教程中都有描述,但不知何故我的 HTML 没有被加载。
这是我的项目结构:
这些是依赖项:
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile("org.springframework.boot:spring-boot-starter-web:2.0.4.RELEASE")
compile group: 'org.thymeleaf', name: 'thymeleaf', version: '2.0.5'
}
它只打印出“Hello”消息,什么也不做,但是,不使用资源文件夹中的 HTML。我错过了什么?
HelloController.java 只有一种方法:
@RequestMapping("/hello")
public String hello(Model model, @RequestParam(value="name",
required=false, defaultValue="World") String name) {
model.addAttribute("name", name);
return "hello " + name;
}
而 main 方法只是通常的运行。
波斯汪
喵喔喔
莫回无
相关分类