Spring Boot学到的内容

  1. Hello World:了解程序入口(创建启动类)
  2. Web程序:写Controller类(@RestController),写Controller方法(@GetMapping),maven依赖spring-boot-starter-web。
  3. 热部署:修改Java类、配置文件自动刷新部署,intellij idea配置自动编译Settings->Compiler->Build project automatically,Ctrl+Shift+Alt+/->Registry->勾选compiler.automake.allow.when.app.running。
  4. 多环境切换:开发(dev)、测试(test)、生产(prod)使用不同配置,在application.properties配置spring.profiles.active指定激活哪个环境配置。
  5. 日志配置:logback-spring.xml,根据多环境切换打印不同日志。
  6. 打包:打成jar包内置了tomcat,打成war包可以放入tomcat运行。

参考博客:https://www.cnblogs.com/moonlightL/p/7891803.html

猜你喜欢

转载自www.cnblogs.com/burthughes/p/9000983.html