SpringBoot簡要

2019獨角獸企業重金招聘Python工程師標準>>> hot3.png

  簡化Spring應用開發的一個框架;
  
  整個Spring技術棧的一個大整合;
  
  J2EE開發的一站式解決方案;
  
  自動配置:針對很多Spring應用程序常見的應用功能,Spring Boot能自動提供相關配置
  
  起步依賴:告訴Spring Boot需要什么功能,它就能引入需要的庫。
  
  命令行界面:這是Spring Boot的可選特性,借此你只需寫代碼就能完成完整的應用程序,無需傳統項目構建。
  
  Actuator:讓你能夠深入運行中的Spring Boot應用程序,一套究竟。
  
  第一個SpringBoot項目
  
  構建一個Sping Boot的Maven項目,強烈推薦Spring Initializr,它從本質上來說就是一個Web應用程序,它能為你生成Spring Boot項目結構。
  
  Spring Initializr有幾種用法:
  
  (一)通過Web界面使用
  
  1.訪問:http://start.spring.io/
  
  2.選擇構建工具Maven Project、Spring Boot版本2.1.0、Group、Artifact,可參考下圖所示
  
  3.點擊Generate Project下載項目壓縮包
  
  4.導入到你的工程,如果是IDEA,則需要:
  
  a.選擇解壓后的項目文件夾,點擊導入
  
  b.點擊Import project from external model并選擇Maven,點擊Next到底為止。
  
  c.選擇對應的JDK版本。(推薦JDK1.8以上)
  
  (二)通過IDEA新建SpringBoot項目(Maven)
  
  在IDEA編輯器的File菜單里面選擇 New > Project,然后選擇Maven項目,接著按照下面的圖一步步操作即可創建第一個SpringBoot項目。
  
  2.導入springBoot的依賴(如果不知道怎么依賴,請去學習maven)
  
  3.編寫主程序,用來啟動SpringBoot應用。
  
  復制代碼
  
  1 /**
  
  2 ?* ?@SpringBootApplication() ?來標注一個主程序,說明是一個springboot應用
  
  3 ?* ?@RestController ? 控制層注解
  
  4 ?*/
  
  5 @SpringBootApplication()
  
  6 @RestController
  
  7 public class HelloWorldMainApplication {
  
  8
  
  9 ? ? /**
  
  10 ? ? ?* spring的注解
  
  11 ? ? ?*/
  
  12 ? ? @RequestMapping(www.dfgjyl.cn"/index")
  
  13 ? ? public String index(www.mengzhidu178.com) {
  
  14 ? ? ? ? return "Hello www.365soke.com Docker World";
  
  15 ? ? }
  
  16
  
  17 ? ? public static void main(String[www.gcyl152.com] args) {
  
  18 ? ? ? ? //讓springboot項目運行起來
  
  19 ? ? ? ? SpringApplication.run(HelloWorldMainApplication.class,args);
  
  20 ? ? }
  
  21 }
  
  復制代碼
  
  4.點擊運行,即可運行程序。在瀏覽器輸入localhost:8080/index即可。
  
  5.簡化部署,在pom文件中加入代碼,使用maven打包,之后直接使用java -jar的命令進行執行。(打完好的jar包會在項目的target目錄下)
  
  復制代碼
  
  <!-- 這個插件,可以將應用打包成一個可執行的jar包;-->
  
  <build>
  
  <plugins>
  
  <plugin>
  
  <groupId>org.springframework.boot<www.gcyl159.com /groupId>
  
  <artifactId>spring-boot-maven-plugin<www.mcyllpt.com /artifactId>
  
  </plugin>
  
  </plugins>
  
  </build>
  
  復制代碼

轉載于:https://my.oschina.net/u/3386278/blog/2876827

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/389231.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/389231.shtml
英文地址,請注明出處:http://en.pswp.cn/news/389231.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

發送郵件 的類 C# .net

/// <summary> /// 發送郵件 /// </summary> /// <param name"SendTo">發送人的地址</param> /// <param name"MyEmail">我的Email地址</param> /// <param name"SendTit…

簡明易懂的c#入門指南_統計假設檢驗的簡明指南

簡明易懂的c#入門指南介紹 (Introduction) One of the main applications of frequentist statistics is the comparison of sample means and variances between one or more groups, known as statistical hypothesis testing. A statistic is a summarized/compressed proba…

計算機科學期刊_成為數據科學家的五種科學期刊

計算機科學期刊The field of data science is advancing at an incredible pace. New scientific articles are published daily. As a student, I try to stay up-to-date with the scientific literature that is published. In this blog post, I created a list of scienti…

Torch.distributed.elastic 關于 pytorch 不穩定

錯誤日志&#xff1a; Epoch: [229] Total time: 0:17:21 Test: [ 0/49] eta: 0:05:00 loss: 1.7994 (1.7994) acc1: 78.0822 (78.0822) acc5: 95.2055 (95.2055) time: 6.1368 data: 5.9411 max mem: 10624 WARNING:torch.distributed.elastic.agent.server.api:Rec…

0x22 迭代加深

poj2248 真是個新套路。還有套路剪枝...大到小和判重 #include<cstdio> #include<iostream> #include<cstring> #include<cstdlib> #include<algorithm> #include<cmath> #include<bitset> using namespace std;int n,D,x[110];bool…

云原生全球最大峰會之一KubeCon首登中國 Kubernetes將如何再演進?

雷鋒網消息&#xff0c;11月14日&#xff0c;由CNCF發起的云原生領域全球最大的峰會之一KubeConCloudNativeCon首次登陸中國&#xff0c;中國已經成為云原生領域一股強大力量&#xff0c;并且還在不斷成長。 毫無疑問&#xff0c;Kubernetes已經成為容器編排事實標準&#xff…

分布分析和分組分析_如何通過群組分析對用戶進行分組并獲得可行的見解

分布分析和分組分析數據分析 (DATA ANALYSIS) Being a regular at a restaurant is great.乙 eing定期在餐廳是偉大的。 When I started university, my dad told me I should find a restaurant I really liked and eat there every month with some friends. Becoming a reg…

python 工具箱_Python交易工具箱:通過指標子圖增強圖表

python 工具箱交易工具箱 (trading-toolbox) After a several months-long hiatus, I can finally resume posting to the Trading Toolbox Series. We started this series by learning how to plot indicators (specifically: moving averages) on the top of a price chart.…

PDA端的數據庫一般采用的是sqlce數據庫

PDA端的數據庫一般采用的是sqlce數據庫,這樣與PC端的sql2000中的數據同步就變成了一個問題,如在PDA端處理,PDA端的內存,CPU等都是一個制約因素,其次他們的一個連接穩定及其間的數據傳輸也是一個難點.本例中通過在PC端的轉化后再復制到PDA上面,這樣,上面所有的問題都得到了一個有…

bzoj 1016 [JSOI2008]最小生成樹計數——matrix tree(相同權值的邊為階段縮點)(碼力)...

題目&#xff1a;https://www.lydsy.com/JudgeOnline/problem.php?id1016 就是縮點&#xff0c;每次相同權值的邊構成的聯通塊求一下matrix tree。注意gauss里的編號應該是從1到...的連續的。 學習了一個TJ。用了vector。自己曾寫過一個只能過樣例的。都放上來吧。 路徑壓縮的…

區塊鏈的模型結構

關于區塊鏈的模型結構問題&#xff0c;行業內已經談論千萬遍了&#xff0c;基本上已經成為一種定義式的問題了。總體上來看&#xff0c;區塊鏈的基礎架構可以分為六層&#xff0c;包括數據層、網絡層、共識層、激勵層、合約層、應用層。每一層分別完成一項核心的功能&#xff0…

數據科學家 數據工程師_數據科學家應該對數據進行版本控制的4個理由

數據科學家 數據工程師While working in a software project it is very common and, in fact, a standard to start right away versioning code, and the benefits are already pretty obvious for the software community: it tracks every modification of the code in a p…

JDK 下載相關資料

所有版本JDK下載地址&#xff1a; http://www.oracle.com/technetwork/java/archive-139210.html 下載賬戶密碼&#xff1a; 2696671285qq.com Oracle123 轉載于:https://www.cnblogs.com/bg7c/p/9277729.html

商米

2019獨角獸企業重金招聘Python工程師標準>>> 今天看了一下商米的官網&#xff0c;發現他家的東西還真的是不錯。有錢了&#xff0c;想去體驗一下。 如果我妹妹還有開便利店的話&#xff0c;我會推薦他用這個。小巧便捷&#xff0c;非常方便。 轉載于:https://my.osc…

C#生成安裝文件后自動附加數據庫的思路跟算法

using System; using System.Collections.Generic; using System.Windows.Forms; using System.Data.SqlClient; using System.Data; using System.ServiceProcess; namespace AdminZJC.DataBaseControl { /// <summary> /// 數據庫操作控制類 /// </summary> …

python交互式和文件式_使用Python創建和自動化交互式儀表盤

python交互式和文件式In this tutorial, I will be creating an automated, interactive dashboard of Texas COVID-19 case count by county using python with the help of selenium, pandas, dash, and plotly. I am assuming the reader has some familiarity with python,…

不可不說的Java“鎖”事

2019獨角獸企業重金招聘Python工程師標準>>> 前言 Java提供了種類豐富的鎖&#xff0c;每種鎖因其特性的不同&#xff0c;在適當的場景下能夠展現出非常高的效率。本文旨在對鎖相關源碼&#xff08;本文中的源碼來自JDK 8&#xff09;、使用場景進行舉例&#xff0c…

數據可視化 信息可視化_可視化數據以幫助清理數據

數據可視化 信息可視化The role of a data scientists involves retrieving hidden relationships between massive amounts of structured or unstructured data in the aim to reach or adjust certain business criteria. In recent times this role’s importance has been…

VS2005 ASP.NET2.0安裝項目的制作(包括數據庫創建、站點創建、IIS屬性修改、Web.Config文件修改)

站點&#xff1a; 如果新建默認的Web安裝項目&#xff0c;那它將創建的默認網站下的一個虛擬應用程序目錄而不是一個新的站點。故我們只有創建新的安裝項目&#xff0c;而不是Web安裝項目。然后通過安裝類進行自定義操作&#xff0c;創建新站如下圖&#xff1a; 2、創建新的安項…

docker的基本命令

docker的三大核心&#xff1a;倉庫(repository),鏡像(image),容器(container)三者相互轉換。 1、鏡像(image) 鏡像&#xff1a;組成docker容器的基礎.類似安裝系統的鏡像 docker pull tomcat 通過pull來下載tomcat docker push XXXX 通過push的方式發布鏡像 2、容器(container)…