一、环境准备

1.JDK环境搭建

2.安装配置MAVEN

二、创建springboot项目

STS安装

1.STS介绍
Spring Tools Suite (STS)其实就是一个被包装过的Eclipse,主要用于快速的开发Spring项目,我们不用再去编辑繁琐的xml配置文件,而是由工具自动生成。STS有两种安装方式,一种是直接在Eclipse中安装STS插件,另一种是直接下载和安装STS。STS官网上有发布版直接下载解压打开即可。
下载地址:https://spring.io/tools/
2.使用
用SpringBoot写第一个helloworld
解压后直接打开
用SpringBoot写第一个helloworld
用SpringBoot写第一个helloworld
配置本地仓库

访问https://start.spring.io/快捷创建springboot项目

用SpringBoot写第一个helloworld
用SpringBoot写第一个helloworld
通过spring向导来生成一个简单的maven工程
在STS中引入该项目
用SpringBoot写第一个helloworld
目录结构:
java:java文件
resources:
--------static:静态资源(js css 图片 音频 视频)
--------templates:模板文件(freemarker)
--------application.properties:配置文件
直接运行该项目
用SpringBoot写第一个helloworld

创建HelloWorld类

用SpringBoot写第一个helloworld
运行工程
直接访问localhost:8080/hello

用SpringBoot写第一个helloworld
不需要部署tomcat直接就能打印出来!

相关文章: