博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Spring Boot系列学习文章(一) -- Intellij IDEA 搭建Spring Boot项目
阅读量:4324 次
发布时间:2019-06-06

本文共 944 字,大约阅读时间需要 3 分钟。

前言:

       最近做的一个项目是用Spring Boot来做的,所以把工作中遇到的一些知识点、问题点整理一下,做成一系列学习文章,供后续学习Spring Boot的同仁们参考,我也是第一次接触Spring Boot,不足之处,请多指教。

 

 

Intellij IDEA 搭建Spring Boot项目,步骤如下:

 

1、选择File –> New –> Project –>Spring Initializr,点击Next

      

2、修改Group、Artifact,点击Next

      

3、选择Web,以及Spring Boot的版本,点击Next

      

4、选择项目路径,点击Finish

      

5、等待编译完成(下载依赖会比较慢~~)

6、删除这三个文件

      

7、项目的目录结构

      

8、创建项目所需的目录

      

9、新建一个HelloController类

     

1 package com.hyl.springdemo.controller; 2  3 import org.springframework.web.bind.annotation.RequestMapping; 4 import org.springframework.web.bind.annotation.RestController; 5  6 @RestController 7 public class HelloController { 8  9     @RequestMapping("/hello")10     private String index(){11         return "Hello Spring Boot!";12     }13 }

 10、给项目配置port、path

        

11、启动项目

       右击SpringDemoApplication,选择run SpringDemoApplication

       

 

       启动之后,会在控制台看到以下提示信息:

       

 

 12、在浏览器中输入http://localhost:8221/annetest/hello,查看页面

        

       看到以上画面,就说明我们的项目创建成功了

       后续便可以在此项目基础上去实现更多功能

 

转载于:https://www.cnblogs.com/AnneHan/p/10318343.html

你可能感兴趣的文章
python基础之数据类型
查看>>
CSS居中初探
查看>>
element-ui table 点击分页table滚动到顶部
查看>>
UVa 1585 Score 得分 题解
查看>>
洛谷 P2197 nim游戏
查看>>
Linux中对为本去重
查看>>
layui下拉框数据过万渲染渲染问题解决方案
查看>>
有序列表和无序列表
查看>>
Bootstrap文档
查看>>
【翻译】在Ext JS集成第三方库
查看>>
中华优秀传统文化教育的有效渗透
查看>>
计算机基础篇-01
查看>>
leetcode 58. Length of Last Word
查看>>
ios开发证书,描述文件,bundle ID的关系
查看>>
jsp之简单的用户登录系统(纯jsp)
查看>>
js计时事件
查看>>
EntityFramework 学习 一 Eager Loading
查看>>
dispatch_set_target_queue测试
查看>>
自己写的sql排序
查看>>
关于Mutex的笔记
查看>>