博客
关于我
Spring boot入门应用
阅读量:178 次
发布时间:2019-02-28

本文共 1272 字,大约阅读时间需要 4 分钟。

一 环境要求
开发环境JDK:1.8
项目管理工具:Maven
开发工具(Eclipse)
二 入门
1 创建Maven项目
2 修改pom文件
4.0.0
cn.itsource
springboot-hello
0.0.1-SNAPSHOT
org.springframework.boot
spring-boot-starter-parent
1.4.1.RELEASE
1.8
org.springframework.boot
spring-boot-starter-web
3 jar包的依赖关系
三 项目错误修改方法
【windows】->【show view】->【other】
四 创建一个controller
HelloController.java
package cn.itsource.springboot.controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;@RestControllerpublic class HelloController {     @RequestMapping("/hello")     public String hello(){           return "Hello SpringBoot";     }}
五 创建一个启动类
变化一下包的组织格式
App.java
package cn.itsource.springboot;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplicationpublic class App {     public static void main(String[] args){           SpringApplication.run(App.class, args);     }}
六 运行
七 验证
你可能感兴趣的文章
Mysql 学习总结(87)—— Mysql 执行计划(Explain)再总结
查看>>
Mysql 学习总结(88)—— Mysql 官方为什么不推荐用雪花 id 和 uuid 做 MySQL 主键
查看>>
Mysql 学习总结(89)—— Mysql 库表容量统计
查看>>
mysql 实现主从复制/主从同步
查看>>
mysql 审核_审核MySQL数据库上的登录
查看>>
mysql 导入 sql 文件时 ERROR 1046 (3D000) no database selected 错误的解决
查看>>
mysql 导入导出大文件
查看>>
mysql 将null转代为0
查看>>
mysql 常用
查看>>
MySQL 常用列类型
查看>>
mysql 常用命令
查看>>
Mysql 常见ALTER TABLE操作
查看>>
mysql 往字段后面加字符串
查看>>
mysql 快速自增假数据, 新增假数据,mysql自增假数据
查看>>
Mysql 报错 Field 'id' doesn't have a default value
查看>>
MySQL 报错:Duplicate entry 'xxx' for key 'UNIQ_XXXX'
查看>>
mysql 排序id_mysql如何按特定id排序
查看>>
Mysql 提示:Communication link failure
查看>>
mysql 插入是否成功_PDO mysql:如何知道插入是否成功
查看>>
Mysql 数据库InnoDB存储引擎中主要组件的刷新清理条件:脏页、RedoLog重做日志、Insert Buffer或ChangeBuffer、Undo Log
查看>>