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. java爬虫案例学习

    最近几天很无聊,学习了一下java的爬虫,写一些自己在做这个案例的过程中遇到的问题和一些体会1.学习目标         练习爬取京东的数据,图片+价格+标题等等 2.学习过程 1·开发工具      ...

  2. Reactjs项目性能优化

    在construct中绑定函数this shouldComponentUpdate React.PureComponent 无状态组件 chrome浏览器性能优化工具 setTimeout,setIn ...

  3. js-day02-BOM和DOM

    BOM和Document对象常见属性和方法: BOM是browser object model的缩写,简称浏览器对象模型. Document 对象每个载入浏览器的 HTML 文档都会成为 Docume ...

  4. 【DFS】求水洼的数目

    题目: 有一个大小为 N*M 的园子,雨后积起了水.八连通的积水被认为是连接在一起的.请求出园子里总共有多少水洼?(八连通指的是下图中相对 W 的*的部分) *** *W* *** 限制条件:N, M ...

  5. [Swift]LeetCode225. 用队列实现栈 | Implement Stack using Queues

    Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. po ...

  6. [Swift]LeetCode226. 翻转二叉树 | Invert Binary Tree

    Invert a binary tree. Example: Input: 4 / \ 2 7 / \ / \ 1 3 6 9 Output: 4 / \ 7 2 / \ / \ 9 6 3 1 Tr ...

  7. [Swift]LeetCode251.展平二维向量 $ Flatten 2D Vector

    Implement an iterator to flatten a 2d vector. For example,Given 2d vector = [ [1,2], [3], [4,5,6] ] ...

  8. [Swift]LeetCode316. 去除重复字母 | Remove Duplicate Letters

    Given a string which contains only lowercase letters, remove duplicate letters so that every letter ...

  9. [Swift]LeetCode397. 整数替换 | Integer Replacement

    Given a positive integer n and you can do operations as follow: If n is even, replace n with n/2. If ...

  10. JavaScript 正则表达式全面总结

    本文适合有 JavaScript 基础 && 面向搜索引擎书写正则的人群. 正则表达式是用于匹配字符串中字符组合的模式.正则表达式的模式规则是由一个字符序列组成的.包括所有字母和数字在 ...