IntelliJ IDEA 开发Spring-Boot之Hello World
2017-09-22 16:55
351 查看
最近初试Spring Boot,下面简单描述IntelliJ IDEA下开发一个简单的SpringBoot的Hello World项目
一、创建项目:之后,填写项目名称和位置,点击完成
二、 项目结构如下:
创建一个Controller类:IndexController
package com.diviner.springboot.controller;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author: SQQ
* @Date: 2017/9/22
* @Email: 815774079@qq.com
* @CreateTime 2017/9/22 16:15
* @License: Diviner
* @Copyright: Diviner
*/
@RestController
@EnableAutoConfiguration
public class IndexController {
@RequestMapping("index")
public String index() {
System.out.println("进入Controller……");
return "Hello Spring-Boot";
}
}
三、 运行项目初始化自动创建的main方法来启动项目,之后在浏览器输入访问地址:http://localhost:8080/index
显示结果则 表示成功!
至此,SpringBoot的HelloWorld项目完成
相关文章推荐
- SpringBoot + MyBatis + MySQL + Maven在Intellij IDEA下开发环境的搭建
- SpringBoot + MyBatis + MySQL + Maven在Intellij IDEA下开发环境的搭建
- spring boot 入门(一):IntelliJ IDEA 实现hello world
- 使用Spring Boot开发 “Hello World” Web应用
- SpringBoot + MyBatis + MySQL + Maven在Intellij IDEA下开发环境的搭建
- IntelliJ IDEA 中开发springboot之入门案例(HelloWorld)
- SpringBoot + MyBatis + MySQL + Maven在Intellij IDEA下开发环境的搭建
- IntelliJ IDEA 创建spring boot 的Hello World 项目(图解)
- SpringBoot + MyBatis + MySQL + Maven在Intellij IDEA下开发环境的搭建
- SpringBoot + MyBatis + MySQL + Maven在Intellij IDEA下开发环境的搭建
- SpringBoot + MyBatis + MySQL + Maven在Intellij IDEA下开发环境的搭建
- IntelliJ IDEA 创建spring boot 的Hello World 项目
- [Spring Boot实战系列] - No.1 开发第一个应用程序 Hello World
- SpringBoot + MyBatis + MySQL + Maven在Intellij IDEA下开发环境的搭建
- SpringBoot + MyBatis + MySQL + Maven在Intellij IDEA下开发环境的搭建
- SpringBoot + MyBatis + MySQL + Maven在Intellij IDEA下开发环境的搭建
- 使用Intellij IDEA 开发 Spring-boot项目 热部署,自动部署
- SpringBoot + MyBatis + MySQL + Maven在Intellij IDEA下开发环境的搭建
- SpringBoot + MyBatis + MySQL + Maven在Intellij IDEA下开发环境的搭建