IntellijIDEA如何创建spring-boot项目-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
IntellijIDEA如何创建spring-boot项目

这篇文章将为大家详细讲解有关Intellij IDEA如何创建spring-boot项目,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

双牌网站建设公司成都创新互联公司,双牌网站设计制作,有大型网站制作公司丰富经验。已为双牌近千家提供企业网站建设服务。企业网站搭建\外贸营销网站建设要多少钱,请找那个售后服务好的双牌做网站的公司定做!

开发环境:

  • jdk版本:JDK8 

  • maven版本:maven-3.5.2

  • 开发工具:Itellij IDEA 2017.1

前提条件:已安装以上软件并配置好jdk和maven的环境变量

创建步骤:

点击坐上角file ---》选择new ---》点击project... 如下图所示:

Intellij IDEA如何创建spring-boot项目

点击左边Spring Initializr ---》 右上角新建jdk(若有则不需要) ---》 点击next 如下图所示:

Intellij IDEA如何创建spring-boot项目

看需求修改下图中的信息后点击next(可以直接使用默认)

Intellij IDEA如何创建spring-boot项目

点击左边的Web ---》 选中中间列的Web ---》 点击next 如下图所示:

Intellij IDEA如何创建spring-boot项目

输入项目名称和保存路径 --- 》点击finish

Intellij IDEA如何创建spring-boot项目

创建的项目如下图所示:

Intellij IDEA如何创建spring-boot项目

创建HelloController类,代码如下所示:

package com.example.demo.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/hello")
public class HelloController {
 @RequestMapping("/say")
 public String sayHello() {
  return "hello world";
 }
}

执行DemoApplication中main方法后访问http://localhost:8080/hello/say 页面如下所示:

Intellij IDEA如何创建spring-boot项目

关于“Intellij IDEA如何创建spring-boot项目”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。


网页名称:IntellijIDEA如何创建spring-boot项目
本文网址:http://scgulin.cn/article/gsdesg.html