博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Springboot入门
阅读量:3960 次
发布时间:2019-05-24

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

spring boot介绍:

Spring Boot来简化Spring应用开发,约定大于配置,去繁从简, just run就能创建一个独立的,产品级别的应用;

背景:J2EE笨重的开发、繁多的配置、低下的开发效率、复杂的部署流程、第三方技术集成难度大。
解决:"Spring全家桶”时代。Spring Boot→J2EE-站式解决方案、Spring Cloud→分布式整体解决方案;

编写我的第一个Spring Boot项目

1.创建一个maven工程,导入spring boot相关的依赖:

org.springframework.boot
spring-boot-starter-parent
1.5.9.RELEASE
org.springframework.boot
spring-boot-starter-web

2.编写一个主程序;启动Spring Boot应用:

@SpringBootApplication/** *  @SpringBootApplication 来标注一个主程序类,说明这是一个Spring Boot应用 */public class SpringBootMain {
public static void main(String[] args) {
SpringApplication.run(SpringBootMain.class,args); }}

3.编写Controller层:

@Controllerpublic class SpringController {
@RequestMapping("/select") @ResponseBody public String index(){
return "我的第一个Springboot项目"; }}

4、运行主程序测试

转载地址:http://rlqzi.baihongyu.com/

你可能感兴趣的文章
P5-c++内存模型和名称空间-01头文件相关
查看>>
P6-c++内存模型和名称空间-02存储连续性、作用域和链接性
查看>>
P9-c++对象和类-02构造函数和析构函数总结
查看>>
P10-c++对象和类-03this指针详细介绍,详细的例子演示
查看>>
bat备份数据库
查看>>
linux数据库导出结果集且比对 && grep -v ---无法过滤的问题
查看>>
shell函数与自带变量
查看>>
linux下shell获取不到PID
查看>>
sort详解
查看>>
linux,shell中if else if的写法,if elif
查看>>
shell中单引号、双引号、反引号的区别
查看>>
shell脚本死循环方法
查看>>
shell中$*和$@的区别
查看>>
log4cxx 的编译安装过程和使用
查看>>
简单邮件系统程序
查看>>
STL里的multimap使用详解
查看>>
STL 库其中的 std::string用法总结
查看>>
模态对话框的销毁过程与非模态对话的几种销毁方法
查看>>
C++实现http下载 && 24点计算编码风格
查看>>
memcached了解使用和常用命令详解
查看>>