1 在官网https://start.spring.io/生成spring boot的模板


2 IDEA导入模板,设置如下勾选项,其他选项卡为默认值


3 idea呈现


4 新增controller类

package com.gbm.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import java.util.HashMap;
import java.util.Map; /**
* Created by Administrator on 2019/2/20.
*/ @Controller
public class IndexController {
@RequestMapping("/index")
@ResponseBody
public String index() {
return "我爱北京天安门!";
}
}

5 增加ComponentScan注解,并运行main方法(见下图,包含运行日志,本例子增加了spring security,故在运行日志中出现了一行“Using generated security password”)

package com.gbm.myspingboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan; @SpringBootApplication
@ComponentScan(basePackages = {"com.gbm.controller"})
public class MyspingbootApplication { public static void main(String[] args) {
SpringApplication.run(MyspingbootApplication.class, args);
} }


6 任何浏览器上运行 http://localhost:8080/index

成功导入springboot!

Spring系列之——使用模板快速搭建springboot项目的更多相关文章

  1. 在线官网Spring Initializr 或 IntelliJ IDEA 快速搭建springboot项目

    Spring Boot是由Pivotal团队提供的全新框架,设计目的是用来简化新Spring应用的初始搭建以及开发过程.它主要推崇的是'消灭配置’,实现零配置. 那么,如何快速新建一个一个spring ...

  2. 小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_2-1.快速搭建SpringBoot项目,采用Eclipse

    笔记 1.快速搭建SpringBoot项目,采用Eclipse     简介:使用SpringBoot start在线生成项目基本框架并导入到eclipse中 1.站点地址:http://start. ...

  3. 使用IDEA快速搭建Springboot项目

    Spring Boot是由Pivotal团队提供的全新框架,设计目的是用来简化新Spring应用的初始搭建以及开发过程.它主要推崇的是'消灭配置’,实现零配置. 下面就介绍一下如何使用idea快速搭建 ...

  4. 小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_2-2.快速搭建SpringBoot项目,采用IDEA

    笔记 2.快速搭建SpringBoot项目,采用IDEA     简介:使用SpringBoot start在线生成项目基本框架并导入到IDEA中 参考资料:         IDEA使用文档    ...

  5. Spring Boot 学习(一) 快速搭建SpringBoot 项目

    快速搭建一个 Spring Boot 项目 部分参考于<深入实践Spring Boot>.<Spring实战 第四版>与程序猿DD的有关博客. 参考(嘟嘟独立博客):http: ...

  6. idea快速搭建springboot项目

    Spring Boot是由Pivotal团队提供的全新框架,设计目的是用来简化新Spring应用的初始搭建以及开发过程.它主要推崇的是'消灭配置',实现零配置. 那么,如何在idea中创建一个spri ...

  7. SpringBoot学习:在Interillj Idea上快速搭建SpringBoot项目

    一.创建SpringBoot项目 二.导入Jar包(pom.xml) <?xml version="1.0" encoding="UTF-8"?> ...

  8. 快速搭建SpringBoot项目

    Spring Boot简介: Spring Boot是Spring社区发布的一个开源项目,旨在帮助开发者快速并且更简单的构建项目.它使用习惯优于配置的理念让你的项目快速运行起来,使用Spring Bo ...

  9. SpringBoot学习:IDEA中快速搭建springboot项目

    项目下载地址:http://download.csdn.net/detail/aqsunkai/9805821 (一)IDEA中创建maven web项目 创建好项目后设置项目的编译路径: (二)引入 ...

随机推荐

  1. angular核心原理解析3:指令的执行过程

    指令的执行过程分析. 我们知道指令的执行分两个阶段,一个是compile,一个是link. 我们可以在指令中自定义compile和link. 首先,我们来讲解如何自定义link函数 举个例子: < ...

  2. [CISCO] 交换机间链路聚合端口聚合

    [CISCO] 交换机间链路聚合端口聚合 一.Introduction 端口通道( port channel ) 是一种聚合多个物理接口 ( that ) 创建一个逻辑接口.你可以捆扎( bundle ...

  3. Laravel 完整开源项目大全

    来自 Laravel学院:http://laravelacademy.org/ http://laravelacademy.org/laravel-project 原型项目 Laravel 5 Boi ...

  4. windows10 pip install MySQL-python mysqlclient

    https://dev.mysql.com/downloads/connector/python/ 到上述地址下载对应系统的驱动程序安装即可. 安装mysqlclient方法如下: https://w ...

  5. L06-Ubuntu系统中部署Vagrant和VirtualBox

    一.前言 1.Vagrant是一个搭建完整的虚拟开发环境的工具~~~更多关于Vagrant理论可查看这篇博文https://www.cnblogs.com/davenkin/p/vagrant-vir ...

  6. find查找文件命令 - Linux系统中的常用技巧整理

    “find”在Linux系统中是比较常用的文件查找命令,使用方法有很多,可以拥有查找文件.文件目录.文件更新时间.文件大小.文件权限及对比文件时间.下面是整理的“find”常用方法,方便以后需要的时候 ...

  7. word里的字号与html字号的对应关系

    在word里输入一段文字,把文字调成需要的大小,即"三号或者小三",然后把文件另存为网页,在格式里选择“html”格式,然后把word关闭,将另存的html文件用编辑工具打开,就可 ...

  8. vue-cli3 chainWebpack配置,去除打包后文件的预加载prefetch/preload(已解决)

    //细节配置修改 chainWebpack: config => { console.log(config,'chainWebpack') // 移除 prefetch 插件 config.pl ...

  9. 1.CentOS6.5下的基础DNS配置

    常规DNS的安全和配置1.安装DNSyum -y install bind bind-utils安装后生成的文件,我们主要配置下面几个/etc/named.conf/var/named/xx这个xx是 ...

  10. 工程手机设置apn

    http://android.stackexchange.com/questions/117125/how-do-i-add-an-apn-via-adb xiaomi3 su mount permi ...