Idea2019创建Springboot Web项目的方法步骤
作者:oneloser
这篇文章主要介绍了Idea2019创建Springboot Web项目的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
1、Idea及Java版本:Idea2019.1 + jdk1.8
2、File > Peoject
3、Spring Initializr:
4、之后会自动下载需要的相关文件
5、src > main > com.xxx.xxx下创建HelloController,内容如下:
package com.weihua.xxx; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @RequestMapping(value = "/hello", method = RequestMethod.GET) public String helloWorld () { return "Hello World !"; } }
6、运行XxxApplication,在浏览器窗口输入http://localhost:8080/hello,页面显示:Hello World !
7、src > main > resources > static下存放静态资源文件如html、js、css等。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
- 从零开始使用IDEA创建SpringBoot项目(图文)
- IDEA创建SpringBoot的maven项目的方法步骤
- 在IDEA中创建跑得起来的Springboot项目
- 使用IDEA创建SpringBoot项目的方法步骤
- idea创建springboot项目和springcloud项目的详细教程
- IDEA创建springboot + mybatis项目全过程(步骤详解)
- 利用IDEA社区版创建SpringBoot项目的详细图文教程
- IDEA教程创建SpringBoot前后端分离项目示例图解
- idea创建Springboot多模块项目(聚合项目)
- 在idea中创建SpringBoot模块的两种方式
- IntelliJ IDEA2025创建SpringBoot项目的实现步骤