Spring Boot 概述:

Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".
We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need very little Spring configuration.

Spring Boot可以轻松创建独立的,生产级的基于Spring的应用程序,而你需要做的仅仅是run 这个项目。
Spring Boot 的设计是为了让你尽可能快的跑起来 Spring 应用程序并且尽可能减少你的配置文件。

Spring Boot特性:

  • 创建独立运行的Spring应用程序

  • 直接嵌入Tomcat,Jetty或Undertow(无需部署WAR文件)

  • 提供starter简化maven配置

  • 尽可能自动配置Spring和第三方库

  • 提供准生产的应用监控功能,例如指标,运行状况检查

  • 绝对没有代码生成,也不需要XML配置

  • Spring Boot快速搭建web项目

Spring Boot项目搭建

  1. 访问:https://start.spring.io/,如下图所示(spring boot版本2.1.2,依赖了web)填写相关的项目信息、依赖等,就会生成一个maven项目的压缩包,下载解压

spring官网截图

  1. 打开idea,找到file-->open-->选择项目的路径,找打pom文件-->以project 形式打开

    idea导入截图

    选择Open as Project截图

  2. 编写HelloController,放到包(com.example.helloSpringBoot.controller)下,HelloController代码如下:

package com.example.helloSpringBoot.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; @RestController
public class HelloController {
    @RequestMapping("/hello")
    public String HelloSpring (){
        System.out.println("hello spring boot");
        return "hello spring boot";
    }
}
  1. 点击运行按钮,查看运行结果,截图如下:

    运行按钮截图

    运行日志截图

  2. 项目启动成功后,浏览器输入 http://localhost:8080/hello 访问,看到下面成功截图后,说明项目搭建成功

浏览器访问截图


下面的是我的公众号二维码图片,欢迎关注,欢迎留言,一起学习,一起进步。

Java碎碎念公众号

Spring Boot入门-快速搭建web项目的更多相关文章

  1. 使用idea搭建Spring boot+jsp的简单web项目

    大家好: 这是我的第一篇博客文章,简单介绍一下Spring boot + jsp 的搭建流程,希望给跟我一样新接触Spring boot的读者一点儿启发. 开发工具:jdk1.8   idea2017 ...

  2. Spring-Boot快速搭建web项目详细总结

    最近在学习Spring Boot 相关的技术,刚接触就有种相见恨晚的感觉,因为用spring boot进行项目的搭建是在太方便了,我们往往只需要很简单的几步,便可完成一个spring MVC项目的搭建 ...

  3. 使用Spring Boot来加速Java web项目的开发

    我想,现在企业级的Java web项目应该或多或少都会使用到Spring框架的. 回首我们以前使用Spring框架的时候,我们需要首先在(如果你使用Maven的话)pom文件中增加对相关的的依赖(使用 ...

  4. (第01节)IDEA快速搭建web项目

    在配置好环境,熟悉了IDEA的基本操作后,就要开始搭建WEB项目了: File——>new——>project——>然后选择Maven 点击Create from archetype ...

  5. IDEA下Spring Boot的快速搭建

    下边使用的是IDEA快速搭建一个Spring Boot项目 (1)File--New-New Project (2)点击Next填写相应的信息 (3)点击Next,选择Dependencies,这里创 ...

  6. IDEA快速搭建WEB项目【记录篇】

    这里用的都是市面上通用的技术,而每个公司都有自己的调用方式,可以根据实际情况与业务场景不同去进行变通 三层架构: 界面层(User Interface layer).业务逻辑层(Business Lo ...

  7. Spring Boot集成MyBatis开发Web项目

    1.Maven构建Spring Boot 创建Maven Web工程,引入spring-boot-starter-parent依赖 <project xmlns="http://mav ...

  8. Django+Vue.js框架快速搭建web项目

    一.vue环境搭建1.下载安装node.js.2.安装淘宝镜像cnpm,在命令窗口输入: npm install -g cnpm --registry=https://registry.npm.tao ...

  9. 初入spring boot(四 )web项目

    1. 模板引擎 spring boot提供了大量的模板引擎,包括FreeMark.Groovy.Thymeleaf.Velocity等,但spring boot中推荐用Thymeleaf,因为Thym ...

随机推荐

  1. 基于Jmeter的thrift-RPC接口测试

    根据需求,产品部分功能采用thrift-RPC协议进行接口的增.删.改.查,前期采用Junit对其进行测试,为了提高RPC接口测试的简洁化和后期的性能测试需求,打算通过Jmeter的java类测试实现 ...

  2. layui select使用问题

    1.需要引用form模板 layui.use(['form'], function () { var form = layui.form; }); 2.html代码 <div class=&qu ...

  3. 解决TCPDF中文乱码,PHP

    /* **主要是这个单词控制 stsongstdlight **/ $this->SetFont('stsongstdlight', 'B', 10);

  4. DCOS实践分享(1):基于图形化模型设计的应用容器化实践

    2015年11月29日,Mesos Meetup 第三期 - 北京技术沙龙成功举行.本次活动由数人科技CTO 肖德时 和 Linker Networks 的 Sam Chen 一起组织发起. 在这次m ...

  5. 关于HTTP协议,这一篇就够了

    HTTP简介 HTTP协议是Hyper Text Transfer Protocol(超文本传输协议)的缩写,是用于从万维网(WWW:World Wide Web )服务器传输超文本到本地浏览器的传送 ...

  6. qq跳转

    给<a href="http://wpa.qq.com/msgrd?v=3&uin=1061214467&site=qq&menu=yes">& ...

  7. #研发解决方案#研发协作平台CloudEngine

    Cloud Engine:大杀器如何炼成 郑昀(微博:http://weibo.com/yunzheng) 创建于2016/6/18 最后更新于2016/6/19 点击查看我的<如何从零搭建一个 ...

  8. [Swift]LeetCode637. 二叉树的层平均值 | Average of Levels in Binary Tree

    Given a non-empty binary tree, return the average value of the nodes on each level in the form of an ...

  9. [Swift]LeetCode881. 救生艇 | Boats to Save People

    The i-th person has weight people[i], and each boat can carry a maximum weight of limit. Each boat c ...

  10. [Swift]LeetCode894. 所有可能的满二叉树 | All Possible Full Binary Trees

    A full binary tree is a binary tree where each node has exactly 0 or 2 children. Return a list of al ...