标签:void too 启动 tap 资源文件 ppi 常见 pre star
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
</dependencies>
@SpringBootApplication
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
@Controller
public class IndexController {
@GetMapping("nav")
public String index(@RequestParam(name = "name", required = false) String name, Model model) {
model.addAttribute("name", name);
return "index";
}
}
resource下创建templates目录,目录下创建html文件
Cannot find template location: classpath:/templates/ 检查打包是否pom(不要)
标签:void too 启动 tap 资源文件 ppi 常见 pre star
原文地址:https://www.cnblogs.com/KingJA/p/14012666.html