springboot学习-综合运用(一)

_鹰_ 2021-02-23 16:15:54
学习 SpringBoot 运用 综合


1、默认打成jar架包,想打成war包,在tomcat下面能够运行;

(1)2.*.*以下版本参考spring-boot-package-war打包,配置下ServletInitializer初始化Application就好;

pom.xml文件修改

<packaging>war</packaging>

Application类文件同级目录新增文件 ServletInitializer类文件

import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;

 

public class ServletInitializer extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }
}

(2)2.*.*以下版本

版权声明
本文为[_鹰_]所创,转载请带上原文链接,感谢
https://my.oschina.net/cs20160712/blog/4960710

  1. Deep understanding of Web protocol (3): http 2
  2. Tencent IEG open source AI SDK: automatic testing of chicken eating and MoBa games
  3. Mysql Command
  4. Docker dockerfile create image
  5. Redis Cluster
  6. 死磕Spring之IoC篇 - 文章导读
  7. Deep understanding of Web protocol (3): http 2
  8. JavaScript BOM operation
  9. JavaScript BOM operation
  10. 死磕Spring之IoC篇 - 文章导读
  11. k8s node 操作与维护
  12. k8s 证书更新
  13. 【Java面试题第三期】JVM中哪些地方会出现内存溢出?出现的原因是什么?
  14. HashMap连环问你能答出几道?
  15. k8s-cronjob
  16. k8s-cert
  17. 头条面试官:说说Kafka的消费者提交方式,怎么实现的
  18. 什么是HTTPS以及如何实施HTTPS?
  19. Spring: an introduction to IOC
  20. Spring: an introduction to IOC
  21. Operation and maintenance of k8s node
  22. K8s certificate update
  23. vue使用sdk进行七牛上传
  24. k8s-dns
  25. JavaScript 邮箱验证 - 正则验证
  26. k8s-dashboard
  27. HashMap连环问你能答出几道?
  28. Where does memory overflow occur in the JVM? What are the reasons for this?
  29. How many questions can you answer?
  30. k8s-cronjob
  31. spring注解--Transactional
  32. k8s-cert
  33. Will the Spring Festival holiday be extended to February 27 in 2021? Here comes the response
  34. Headline Interviewer: talk about Kafka's consumer submission method, how to achieve it
  35. 【k8s集群】搭建步骤
  36. k8s-kubeadm
  37. k8s-etcd
  38. What is HTTPS and how to implement it?
  39. Java中使用HashMap改进查找性能
  40. maven发布jar包运行时找不到类问题
  41. J2EE
  42. Vue uses SDK to upload seven cows
  43. k8s-dns
  44. JavaScript mailbox verification - regular verification
  45. k8s-dashboard
  46. How many questions can you answer?
  47. Spring annotation -- transactional
  48. [k8s cluster] construction steps
  49. k8s-kubeadm
  50. k8s-etcd
  51. Using HashMap to improve search performance in Java
  52. There is no class problem when Maven publishes jar package
  53. JavaScriptBOM操作
  54. J2EE
  55. k8s-prometheus-memory
  56. k8s-prometheus disk
  57. k8s-prometheus
  58. JavaScript BOM operation
  59. k8s-prometheus-memory
  60. k8s-prometheus disk