springboot中Hello World Application的探究是怎樣的,相信很多沒有經(jīng)驗的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。

成都創(chuàng)新互聯(lián)公司主要從事網(wǎng)站制作、網(wǎng)站設(shè)計、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)尼金平,10余年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):028-86922220
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.9.RELEASE</version> </parent> spring-boot-starter-parent的父項目: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>1.5.9.RELEASE</version> <relativePath>../../spring-boot-dependencies</relativePath> </parent> spring-boot-dependencies真正來管理Spring Boot項目中所有的依賴版本
Spring Boot的版本仲裁中心,以后我們導入依賴默認不需要寫版本(沒有在spring-boot-dependencies中的依賴就需要聲明版本號)
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
spring-boot-starter-web :
spring-boot-starter: spring boot場景啟動器
/**
* @SpringBootApplication 來標注一個主程序類,說明這是一個Spring boot應用
*/
@SpringBootApplication
public class HelloWorldMainApplication {
public static void main(String[] args) {
//啟動Spring應用
SpringApplication.run(HelloWorldMainApplication.class, args);
}
}@SpringBootApplication: Spring Boot應用注解,標注在某個類上說明這是Spring Boot應用的主入口類,SpringBoot就應該運行這個類的main方法來啟動應用SpringBoot應用
@SpringBootAppliation:
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(
excludeFilters = {@Filter(
type = FilterType.CUSTOM,
classes = {TypeExcludeFilter.class}
), @Filter(
type = FilterType.CUSTOM,
classes = {AutoConfigurationExcludeFilter.class}
)}
)
public @interface SpringBootApplication {
@AliasFor(
annotation = EnableAutoConfiguration.class,
attribute = "exclude"
)
Class<?>[] exclude() default {};
@AliasFor(
annotation = EnableAutoConfiguration.class,
attribute = "excludeName"
)
String[] excludeName() default {};
@AliasFor(
annotation = ComponentScan.class,
attribute = "basePackages"
)
String[] scanBasePackages() default {};
@AliasFor(
annotation = ComponentScan.class,
attribute = "basePackageClasses"
)
Class<?>[] scanBasePackageClasses() default {};
}@SpringBootConfiguration:
SpringBoot的配置類,標準在某個類上,表示這是一個SpringBoot的配置類
@Configuration:配置類(配置文件) -- 也是一個組件Component
@EnableAutoConfiguration:
開啟自動配置功能
看完上述內(nèi)容,你們掌握springboot中Hello World Application的探究是怎樣的的方法了嗎?如果還想學到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!
網(wǎng)站題目:springboot中HelloWorldApplication的探究是怎樣的
文章位置:http://chinadenli.net/article12/ipihgc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供用戶體驗、網(wǎng)頁設(shè)計公司、App設(shè)計、企業(yè)建站、全網(wǎng)營銷推廣、網(wǎng)站收錄
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)