使用IDEA快速创建springboot项目流程:

创建新的项目选择

项目的命名以及包名

需要什么包就导入什么包

进行测试的单元

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

此时的工程默认有这个启动的主程序

Springboot01Application.java
@SpringBootApplication
public class Springboot01Application {
public static void main(String[] args) {
SpringApplication.run(Springboot01Application.class, args);
}
}

新建一个controller包和controller类:

//此时类的所有方法都会返回数据给浏览器(对象是专为json)
//@RestController = @ResponseBody + @Controller

@ResponseBody
@Controller
public class Helloword {
@RequestMapping("/hello")
public String hello(){ return "Hello tow!";
}
}

运行访问:

springboot工程结构:

static文件夹:保存所有的静态资源
templates文件夹:保存所有的模板页面(Springboot默认jar使用嵌入式的Tomcat,默认不支持jsp页面);可以使用模板引擎
application.properties:springboot应用的配置文件

2springboot:快速创建springboot项目的更多相关文章

  1. Spring-boot(一)通过向导快速创建Spring-boot项目

    通过向导快速创建Spring-boot项目 创建步骤: 选择Spring Initializr 填写组织和模块名 选择对应的模块 注:这里左侧的模块比较多,玩家可以根据自己的实际需要自由选择,此处暂时 ...

  2. 【快学springboot】1.快速创建springboot项目

    若图片查看异常,请前往掘金查看:https://juejin.im/post/5d00e793f265da1b614ff10b 使用spring initialize工具快速创建springboot项 ...

  3. SpringBoot入门系列(一)如何快速创建SpringBoot项目

    这段时间也没什么事情,所以就重新学习整理了Spring Boot的相关内容.今天开始整理更新Spring Boot学习笔记,感兴趣的朋友可以关注我的博客:https://www.cnblogs.com ...

  4. 在线快速创建SpringBoot项目

    都2020年了,你还在手动创建SpringBoot项目吗?今天教你在线快速创建一个SpringBoot项目,瞬间高大上有木有! 进入正题,首先打开创建SpringBoot的官网:https://sta ...

  5. 3 快速创建SpringBoot项目

    一.Intellij IDEA 创建Spring Boot项目 1.创建工程  2.选择Spring Initializr 3.设置Maven版本管理参数  4.选择引用模块  5.命名工程名 6.选 ...

  6. 快速创建springboot项目,并进行增删改

    创建普通maven项目,pom依赖如下 <parent> <artifactId>spring-boot-starter-parent</artifactId> & ...

  7. 2.快速创建springboot项目 连pom文件里面的配置都不用配了

    无论是创建项目 还是module 模块 选择这个 .然后在后面的选择中选择自己要的功能 就可以把相关的依赖都加进去 省去了依赖 其后的写法跟第一篇一样 在这个项目下面有一个配置文件 ====>a ...

  8. 使用spring initialization创建SpringBoot项目

    https://blog.csdn.net/liutong123987/article/details/79385513 有很多方法可以快速创建Springboot项目,可以通过idea的spring ...

  9. SrpingBoot入门到入坟03-基于idea快速创建SpringBoot应用

    先前先创建Maven项目然后依照官方文档再然后编写主程序写业务逻辑代码才建立好SpringBoot项目,这样太过麻烦,IDE都支持快速创建,下面基于idea: 使用Spring Initializer ...

随机推荐

  1. 点击checkbox 向input 里面传值显示

    文本框显示 <input type="text" id="textareashow" name="" class="marg ...

  2. 【3】.net MVC 使用IPrincipal进行Form登录即权限验证

    1.在MVC项目中添加用户类,可以根据实际项目需求添加必要属性 public class UserData { /// <summary> /// ID /// </summary& ...

  3. 第八章.Java集合

    Java集合类是一种特别有用的工具类,可用于存储数量不等的对象.Java集合大致可分为Set.List.Queue和Map四种体系 Set代表无序.不可重复的集合 List代表有序.重复的集合 Map ...

  4. linux awk 使用的一个例子

    1. 场景 从日志中获取漏发奖励的司机id 2. 日志 如下(需要获取一个时间段的 driverIdStr) ::-thread-] order.service.TOrderInfoServiceIm ...

  5. linux cut: invalid byte, character or field list Try 'cut --help' for more information.

    1. 概述 centos执行简单shell 脚本 报错 cut: invalid byte, character or field listTry 'cut --help' for more info ...

  6. css手风琴

    <style> .box{ width: 1000px; height: 450px; margin:0 auto; overflow: hidden;} .box div{ width: ...

  7. 基于Vue的WebApp项目开发(一)

    了解webpack的魔力: 项目结构以及开发环境 webpack初体验之打包文件 1.首先创建三个文件,分别是index.html.main.js和calc.js index.html <!DO ...

  8. 任务十六:零基础JavaScript编码(四)

    任务目的 在上一任务基础上继续JavaScript的体验 深入学习JavaScript的事件机制及DOM操作 学习事件代理机制 学习简单的表单验证功能 学习外部加载JavaScript文件 任务描述 ...

  9. Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context.

    代码如下: var query = from s in db.LoginUserServices join ss in db.Services on s.ServiceType equals ss.C ...

  10. win+ R下的常见命令

    -------------------------电脑运行常见命令----------------------------- Windows+R输入cmd 运行net start mssqlserve ...