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. 10. vue axios 请求未完成时路由跳转报错问题

    axios 请求未完成时路由跳转报错问题 前两天项目基本功能算是完成了,在公司测试时遇到了遇到了一个问题,那就是在请求未完成时进行路由跳转时会报错,想了几种办法来解决,例如加loading,请求拦截, ...

  2. linux 重新生成网卡配置文件

    nmcli connection add con-name home type ethernet ifname eth1 autoconnect yes ip4 10.1.252.60/24 gw4 ...

  3. FCC(ES6写法) Map the Debris

    返回一个数组,其内容是把原数组中对应元素的平均海拔转换成其对应的轨道周期. 原数组中会包含格式化的对象内容,像这样 {name: 'name', avgAlt: avgAlt}. 思路: 直接使用公式 ...

  4. FCC(ES6写法) Inventory Update

    依照一个存着新进货物的二维数组,更新存着现有库存(在 arr1 中)的二维数组. 如果货物已存在则更新数量 . 如果没有对应货物则把其加入到数组中,更新最新的数量. 返回当前的库存数组,且按货物名称的 ...

  5. [Swift]LeetCode567. 字符串的排列 | Permutation in String

    Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. I ...

  6. 数据攻略●R语言自述

    (注明:以下文章均在Linux操作系统下执行) 一.R语言简介 R语言是用于统计分析,图形表示和报告的编程语言和软件环境.R语言由Ross Ihaka和Robert Gentleman在新西兰奥克兰大 ...

  7. 雷达无线电系列(一)几种常见的幅度分布函数(matlab)

    文件下载地址: https://github.com/mufasa007/myblog/tree/master/%E9%9B%B7%E8%BE%BE%E6%97%A0%E7%BA%BF%E7%94%B ...

  8. Java9发布回顾Java 8的十大新特性

    java9已经在北京时间9月22日正式发布,开发者可以在oracle jdk官网上下载到最新的jdk9. 今天,我们先来一起复习一下2014年发布的Java 8的十大新特性.先来喝杯java~~~ 按 ...

  9. Python内置函数(13)——complex

    英文文档: class complex([real[, imag]]) Return a complex number with the value real + imag*1j or convert ...

  10. BBS论坛(三十二)

    32.帖子排序功能完成 (1)front_index.html <ul class="post-group-head"> {% if current_sort==1 % ...