>>关于Spring Boot

这是官网描述的特点:

1.Create stand-alone Spring applications

创建独立的Spring应用

2.Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)
内嵌了Tomcat,Jetty或者Undertow,并且不需要部署

3.Provide opinionated 'starter' POMs to simplify your Maven configuration
提供'starter' POMs来简化Maven配置

4.Automatically configure Spring whenever possible
尽可能的自动配置Spring应用

5.Provide production-ready features such as metrics, health checks and externalized configuration
提供生产特征,比如指标,健壮检查和外部化配置

6.Absolutely no code generation and no requirement for XML configuration
绝对没有任何代码生成,并且不需要配置XML

>>创建并运行一个Demo项目

首先在Eclipse中创建一个简单的Maven项目,在pom.xml中添加Spring boot的依赖,

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-web</artifactId>
  4. <version>${spring.boot.version}</version>
  5. </dependency>

创建一个Controller:

  1. @RestController
  2. @EnableAutoConfiguration
  3. public class Controller {
  4.  
  5. @RequestMapping(value="/")
  6. public String test(){
  7. return "hello world!";
  8. }
  9.  
  10. public static void main(String[] args){
  11. SpringApplication.run(Controller.class,args);
  12. }
  13. }

现在直接运行这个Controller就可以启动项目:

现在直接访问http://localhost:8080/,可以看到项目已经运行起来。

>>Spring Boot在这中间做了什么

马克,忙过这段时间好好整理一下。

Spring Boot的快速启动和部署的更多相关文章

  1. Spring Boot:快速入门教程

    什么是Spring Boot? Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程.该框架使用了特定的方式来进行配置,从而使开发人 ...

  2. Spring Boot【快速入门】简单案例

    Spring Boot[快速入门]   Spring Boot 概述 Build Anything with Spring Boot:Spring Boot is the starting point ...

  3. Spring Boot框架——快速入门

    Spring Boot是Spring 全家桶非常重要的一个模块,通过 Spring Boot 可以快速搭建一个基于 Spring 的 Java 应用程序,Spring Boot 对常用的第三方库提供了 ...

  4. 居然仅用浏览器,就完成了Spring Boot应用的开发与部署!

    最近有幸试用了一下阿里云的一个新产品:云开发平台,体验一把全新的开发模式!虽然中间也碰到了一些问题,但整体的体验透露着未来感,因为整个过程都不需要使用我们最常用的IDEA,仅依靠浏览器就把一个Spri ...

  5. 涨姿势:Spring Boot 2.x 启动全过程源码分析

    目录 SpringApplication 实例 run 方法运行过程 总结 上篇<Spring Boot 2.x 启动全过程源码分析(一)入口类剖析>我们分析了 Spring Boot 入 ...

  6. Spring Boot 2.x 启动全过程源码分析

    Spring Boot 2.x 启动全过程源码分析 SpringApplication 实例 run 方法运行过程 上面分析了 SpringApplication 实例对象构造方法初始化过程,下面继续 ...

  7. 【spring boot】spring cloud下spring boot微服务启动没有报错,但是访问访问不到

    spring cloud下spring boot微服务启动没有报错,但是访问访问不到 解决方法: 可能是端口被占用了,但是依旧启用成功了. 更改一下项目启用的端口号,再重新启动查看是否可以正常访问.

  8. Spring Boot项目指定启动后执行的操作

    Spring Boot项目指定启动后执行的操作: (1)实现CommandLineRunner 接口 (2)重写run方法 (3)声明执行顺序@Order(1),数值越小,优先级越高 (4)如果需要注 ...

  9. Spring Boot中快速操作Mongodb

    Spring Boot中快速操作Mongodb 在Spring Boot中集成Mongodb非常简单,只需要加入Mongodb的Starter包即可,代码如下: <dependency> ...

随机推荐

  1. $state.go页面不刷新数据

    http://blog.csdn.net/WenJimmy/article/details/51027952 假如进入market/beian/add添加数据,保存提交后回退market/beian列 ...

  2. 随机添加一个Class,Class提前写好

    $("").hover(function(){ var ary = ["red","green","blue",]; v ...

  3. Unity3D获取Andorid设备返回键,主页键等功能

    在Unity开发中捕捉Android的常用事件其实很简单 在新建的脚本文件中就加入: 比如: // 返回键 if ( Application.platform == RuntimePlatform.A ...

  4. OpenCv haar+SVM训练的xml检测人头位置

    注意:opencv-2.4.10 #include "stdio.h"#include "string.h"#include "iostream&qu ...

  5. 如何用phpstorm编辑远程项目

    背景介绍:LAMP开发是很多公司喜欢采用的技术组合,故而做php开发,使用linux环境也是很多公司的要求.本文就来介绍下如何在windows下,使用phpstorm集成开发环境,来开发放在linux ...

  6. windows安装rsync

    客户端:cwRsync 4.0.5 Installer 服务端:cwRsyncServer 4.0.5 Installer 安装配置Rsync服务端 1.直接双击安装包安装即可,在安装过程中会有要求用 ...

  7. mybatis动态SQL - like

    用'%${name}%'可以实现模糊查询,但会放开SQL注入漏洞. <when test="name != null and name!=''"> AND name l ...

  8. webrtc开源项目音频重采样“不友好接口”的几点总结

    WebRTC(Web Real Time Communication)并不是Google原来自己的技术,在2010年,Google以大约6820万美元收购了VoIP软件 开发商Global IP So ...

  9. 3分钟,9个Q&A让你快速知道Docker到底是什么

    不论是Google.Amazon.Microsoft.VMware都纷纷拥戴,加入Docker和Container所掀起的新时代云端虚拟化行列,这两项技术成为了IT界的新趋势.Docker和Conta ...

  10. 在Webstorm/Phpstorm中设置连接FTP,并快速进行文件比较,上传下载,同步等操作

    Phpstorm除了能直接打开localhost文件之外,还可以连接FTP,除了完成正常的数据传递任务之外,还可以进行本地文件与服务端文件的异同比较,同一文件自动匹配目录上传,下载,这些功能是平常ID ...