Spring Boot返回特定的json格式并打包成jar来部署运行

今天朋友说调接口不想等后台那边写完,需要随便写一点能返回数据的接口,调以下就可以了。所以通过springboot快速搭建了一个demo跑了一下。

Springboot并不需要通过war就能运行web项目。

一、创建Maven项目

通过maven创建一个javaweb项目。

二、添加依赖文件

添加配置端口文件:application.properties

 

三、建立springboot  hello程序

四、启动程序,访问效果

五、添加返回特定格式的json对象的方法

六、重新启动,访问效果如下:

关闭idea编译器跑的程序,复制编译成jsondemo.jar到d盘,并打开cmd窗口。

执行以下命令:java -jar jsondemo.jar

访问浏览器,效果如下:

温馨提示:如果启动需要tomcat支持,那么可以添加以下依赖。

添加嵌入式tomcat依赖

 






如果您认为本教程质量不错,读后觉得收获很大,预期工资能蹭蹭蹭的往上涨,那么不妨小额赞助我一下,让我有动力继续写出高质量的教程。

发布者

souvc

souvc

搜你所想,投你所好。

《Spring Boot返回特定的json格式并打包成jar来部署运行》有516个想法

  1. Pingback: 筛网
  2. Pingback: 防盗窗纱
  3. Pingback: 格宾网
  4. Pingback: 雷诺护垫
  5. Pingback: pvc护栏
  6. Pingback: 玻璃钢格栅
  7. Pingback: 环氧自流平
  8. Pingback: 橡胶支座
  9. Pingback: Wholesale Jerseys
  10. Pingback: Wholesale NFL Jerseys
  11. Pingback: Wholesale NBA Jerseys
  12. Pingback: Cheap Soccer Jerseys
  13. Pingback: Wholesale NFL Jerseys
  14. Pingback: Wholesale Jerseys USA
  15. Pingback: Cheap Jerseys China
  16. Pingback: Cheap Jerseys
  17. Pingback: Wholesale Jerseys
  18. Pingback: Wholesale Jerseys
  19. Pingback: Cheap NHL Jerseys
  20. Pingback: Wholesale NFL Jerseys
  21. Pingback: Cheap NFL Jerseys
  22. Pingback: Wholesale NBA Jerseys
  23. Pingback: Cheap China Jerseys
  24. Pingback: Cheap Jerseys Online
  25. Pingback: Wholesale Jerseys
  26. Pingback: Cheap Jerseys China
  27. Pingback: Wholesale NFL Jerseys
  28. Pingback: Cheap Jerseys
  29. Pingback: Cheap Jerseys
  30. Pingback: Cheap Jerseys Supply
  31. Pingback: Wholesale NFL Jerseys
  32. Pingback: Ozzie Smith Jersey UK
  33. Pingback: Scott Tolzien Jersey
  34. Pingback: Bob Uecker Jersey
  35. Pingback: Bobby Ryan Jersey
  36. Pingback: Michael Cooper Jersey
  37. Pingback: Ian Desmond Jersey
  38. Pingback: pandora charms sale
  39. Pingback: Kemba Walker Jersey
  40. Pingback: Tony Cascio Jersey
  41. Pingback: Wholesale Jerseys
  42. Pingback: Wholesale Jerseys
  43. Pingback: Cheap Jerseys
  44. Pingback: Channing Frye Jersey
  45. Pingback: Ivan Provorov Jersey
  46. Pingback: Wade Boggs Jersey
  47. Pingback: Cheap NFL Jerseys
  48. Pingback: Cheap Jerseys Online
  49. Pingback: Cheap NFL Jerseys
  50. Pingback: Cheap NFL Jerseys
  51. Pingback: Cheap NBA Jerseys
  52. Pingback: Cheap Miami Heat Hats
  53. Pingback: Bo Horvat Jersey
  54. Pingback: Wholesale Jerseys
  55. Pingback: Nike KD
  56. Pingback: Vince Coleman Jersey
  57. Pingback: Pete Rose Jersey
  58. Pingback: Scott Feldman Jersey
  59. Pingback: nike air jordan style
  60. Pingback: maglia Real Madrid
  61. Pingback: nike air lebron 2
  62. Pingback: Liverpool tröja
  63. Pingback: nike lebron james hat
  64. Pingback: maglie calcio
  65. Pingback: nike air max dt 2
  66. Pingback: air jordan logo 480
  67. Pingback: nike uk id 0.5 women
  68. Pingback: new womens nike dunks
  69. Pingback: womens shoes near me
  70. Pingback: maglie calcio
  71. Pingback: fotbollströjor
  72. Pingback: air jordan i brooklyn
  73. Pingback: red pjs women
  74. Pingback: predator turf shoes
  75. Pingback: adidas support adv
  76. Pingback: soccer ball price
  77. Pingback: mens exotic underwear
  78. Pingback: air jordan 1 top 3
  79. Pingback: all red 5 jordans
  80. Pingback: bleu bleu d lillard 2
  81. Pingback: Fodboldtrøjer
  82. Pingback: boys converse size 2
  83. Pingback: nmd black core
  84. Pingback: reebok dmx fusion aff
  85. Pingback: are nike air max
  86. Pingback: highlighters
  87. Pingback: 2019
  88. Pingback: kayak hardware
  89. Pingback: adidas new nmdr1
  90. Pingback: air jordan spiz ike
  91. Pingback: pagenum
  92. Pingback: cleantalkorg2.ru
  93. Pingback: #macron #Lassalle
  94. Pingback: a2019-2020
  95. Pingback: facebook
  96. Pingback: facebook1
  97. Pingback: javsearch.mobi
  98. Pingback: React Element 87
  99. Pingback: womens biker tops
  100. Pingback: maglie calcio bambino
  101. Pingback: Fodboldtrøjer Børn
  102. Pingback: gucci loafers men
  103. Pingback: vans vans sk8 mid
  104. Pingback: hot short pajama
  105. Pingback: nike fs lite run 4
  106. Pingback: nike benassi jdi
  107. Pingback: new balance

发表评论