怎么java做网站
1、第一步:从https://start.spring.io/上面下载一个springboot的maven项目,解压后导入到IDEA或eclipse,在pox.xml添加以下代码:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId></dependency><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>

3、第三步:在配置文件application.properties里面配置thymeleaf,蜣贺鱿柢代码如下:# templates文件夹的路径spring.thymeleaf.prefix=classpath:/templates/# templates中的所有文件后缀名spring.thymeleaf.suffix=.html

5、第五步:新建一个控制器,代码如下:@RequestMapping("/index")public String index(){ return "index";}

7、第七步:这里是简单的一个页面,一个网站就是由很多单个页面组成的,所以这也是一个简单网站