---------------------

1、pom.xml中添加支持web的模块:

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

pom.xml文件中默认有两个模块:

spring-boot-starter:核心模块,包括自动配置支持、日志和YAML;

spring-boot-starter-test:测试模块,包括JUnit、Hamcrest、Mockito。

2、编写controller内容

@RestController
public class HelloWorldController {
@RequestMapping("/hello")
public String index() {
return "Hello World";
}
}

@RestController的意思就是controller里面的方法都以json格式输出,不用再写什么jackjson配置的了!

3、启动主程序,打开浏览器访问http://localhost:8080/hello,就可以看到效果了,有木有很简单!

https://zhuanlan.zhihu.com/p/24957789

https://www.zhihu.com/question/53729800/answer/255785661

------------------------

1.

修改IEDA设置

打开 Settings --> Build-Execution-Deployment --> Compiler,将 Build project automatically.勾上。

点击 Help --> Find Action..,或使用快捷键 Ctrl+Shift+A来打开 Registry...,将 其中的compiler.automake.allow.when.app.running勾上。

https://1few.com/spring-boot-hot-swap/#more-238

第26月第20天 springboot的更多相关文章

  1. 腾讯云 CIF 工程效能峰会,10 月 19 - 20 日震撼来袭!

    近年来,依托于云计算的飞速发展,腾讯云云产品更新迅猛,云原生生态构建初具规模,越来越多的企业也开始寻求与深入数字化转型之路.但在摸索与实践中,企业往往会进入"伪上云"的误区.除了单 ...

  2. 第26月第30天 srt

    1. ffmpeg -i 0.mp4 -vf subtitles=0.srt 1.mp4 https://jingyan.baidu.com/article/c45ad29c73cef2051653e ...

  3. 第26月第29天 ffmpeg yasm

    1. brew install automake fdk-aac git lame libass libtool libvorbis libvpx \ opus sdl shtool texi2htm ...

  4. 第26月第28天 avplayer cache

    1.urlsession https - (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticati ...

  5. 第26月第26天 Domain=AVFoundationErrorDomain Code=-11850

    1. curl -voa http://119.29.108.104:8080/inweb01/kotlin.mp4 -H "Range:bytes=0-1" https://al ...

  6. 第26月第25天 ubuntu openjdk-8-jdk jretty

    1.ubuntu ============== sudo apt-get install openjdk-8-jdk https://blog.csdn.net/zhaohaiyitian88/art ...

  7. 第26月第23天 nsobject 单例 CFAbsoluteTimeGetCurrent

    1.nsobject 单例 sudo chmod 666 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/ ...

  8. 第26月第22天 iOS瘦身之armv7 armv7s arm64选用 iOS crash

    1.iOS瘦身之armv7 armv7s arm64选用 机器对指令集的支持是向下兼容的,因此armv7的指令集是可以运行在iphone5S以上的,只是效率没那么高而已~ 但是由于苹果要求必须支持ar ...

  9. 第26月第18天 mybatis_spring_mvc

    1. applicationContext.xml  配置文件里最主要的配置: <?xml version="1.0" encoding="utf-8"? ...

随机推荐

  1. 洛谷P3703 树点涂色

    题意: 解: 发现我们每次染的都是不同的颜色,那么用lct维护的话一个颜色就会在一个splay里.染色是access. 维护每个节点到根路径上的虚边数量. 虚边的切换只会在access和link中出现 ...

  2. A1011. World Cup Betting

    With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excite ...

  3. MariaDB安装及基本配置

    MariaDB安装及基本配置(CentOS6.9) 数据库基础概念 数据库(Database, DB)是按照数据结构来组织.存储和管理数据的建立在计算机存储设备上的仓库. DBMS: Database ...

  4. openvpn部署账号密码登录

    1.开启服务器端路由转发功能: 修改配置文件/etc/sysctl.conf中 net.ipv4.ip_forward = 0 改为 net.ipv4.ip_forward = 1 [root@nod ...

  5. Web Deploy 服务器安装设置与使用

    一.服务器的安装设置 1.在windows server上确保IIS安装了[管理服务]这个功能.方法是在[服务器管理器]=>[管理]=>[添加角色和功能]=>[下一步]=>[基 ...

  6. GWAS研究可利用的数据库(持续更新)

    1.列表包括数据库名称.表型.是否能下载到基因型(genotype).是否能下载到GWAS结果文件(P值.效应值.SNP位点).目前收集到的有如下: 参考到这些数据库的文献:Genome-wide a ...

  7. ElasticSearch6.3.2------入门

    先去官网下载,方便测试用的Windows版本的 都解压了 --- 启动ElasticSearch和Kibana [E:\elasticsearch-]$ .\bin\elasticsearch.bat ...

  8. go kafka

    安装导入 go get github.com/Shopify/sarama import "github.com/Shopify/sarama" 使用 1.同步生产者 packag ...

  9. Java项目中,如何限制每个用户访问接口的次数

    转自:https://blog.csdn.net/qq_30947533/article/details/78844709 方法1:数据访问量大的话 用redis来做,用户在调用短信接口时,先根据用户 ...

  10. rancher2.0部署

    1.安装前准备 #当前环境介绍 操作系统:CentOS7.3 硬件:2C 4G内存 官网要求Docker版本: 1.12.6 1.13.1 17.03.2 #关闭防火墙 systemctl stop ...