成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

springboot中HelloWorldApplication的探究是怎樣的

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

成都創(chuàng)新互聯(lián)公司主要從事網(wǎng)站制作、網(wǎng)站設計、網(wǎng)頁設計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務。立足成都服務尼金平,10余年網(wǎng)站建設經(jīng)驗,價格優(yōu)惠、服務專業(yè),歡迎來電咨詢建站服務:028-86922220

1. POM文件

1. 父項目

    <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中的依賴就需要聲明版本號)

2. 導入的依賴

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

spring-boot-starter-web :

  • spring-boot-starter: spring boot場景啟動器

2. 主程序類,主入口類

/**
 * @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

  • 開啟自動配置功能

看完上述內容,你們掌握springboot中Hello World Application的探究是怎樣的的方法了嗎?如果還想學到更多技能或想了解更多相關內容,歡迎關注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!

網(wǎng)站題目:springboot中HelloWorldApplication的探究是怎樣的
文章位置:http://jinyejixie.com/article12/ipihgc.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供用戶體驗、網(wǎng)頁設計公司、App設計、企業(yè)建站、全網(wǎng)營銷推廣、網(wǎng)站收錄

廣告

聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

搜索引擎優(yōu)化
海晏县| 台南县| 长汀县| 疏勒县| 东海县| 永德县| 玛纳斯县| 屏边| 黄陵县| 中卫市| 永德县| 金寨县| 丰城市| 博爱县| 海宁市| 承德市| 皋兰县| 高青县| 敦煌市| 莱阳市| 萨迦县| 合肥市| 罗定市| 阿拉尔市| 临澧县| 麦盖提县| 安达市| 周宁县| 新乡县| 施甸县| 奎屯市| 吉木萨尔县| 怀仁县| 庆元县| 武邑县| 抚宁县| 都匀市| 镇远县| 上蔡县| 都昌县| 峡江县|