学习java第一天总结

68 阅读1分钟

使用idea搭建springboot项目

点击new project之后如图所示

image.png

选择java 8

image.png

新建controller目录新建控制器类

image.png

写上接口的路径

image.png

在pom.xml文件上加入依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

在resources目录下新建template和a目录以及html页面

image.png

b.html

<!doctype html>
<html >
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Document</title>
</head>
<body>
 欢迎大家来到java的世界大门
</body>
</html>

启动项目

image.png

在浏览器访问页面

image.png