欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

springboot之端口設(shè)置和contextpath的配置方式

 更新時(shí)間:2022年01月28日 09:24:25   作者:吸引力的覺(jué)悟  
這篇文章主要介紹了springboot之端口設(shè)置和contextpath的配置方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教

端口設(shè)置和contextpath的配置

端口設(shè)置

Spring boot 默認(rèn)端口是8080,如果想要進(jìn)行更改的話,只需要修改applicatoin.properties文件,在配置文件中加入:

server.port= 9090

常用配置:

########################################################
###EMBEDDED SERVER CONFIGURATION (ServerProperties)
########################################################
#server.port=8080
#server.address= # bind to a specific NIC
#server.session-timeout= # session timeout in seconds
#the context path, defaults to '/'
#server.context-path=/spring-boot
#server.servlet-path= # the servlet path, defaults to '/'
#server.tomcat.access-log-pattern= # log pattern of the access log
#server.tomcat.access-log-enabled=false # is access logging enabled
#server.tomcat.protocol-header=x-forwarded-proto # ssl forward headers
#server.tomcat.remote-ip-header=x-forwarded-for
#server.tomcat.basedir=/tmp # base dir (usually not needed, defaults to tmp)
#server.tomcat.background-processor-delay=30; # in seconds
#server.tomcat.max-threads = 0 # number of threads in protocol handler
#server.tomcat.uri-encoding = UTF-8 # character encoding to use for URL decoding

ContextPath配置

Spring boot默認(rèn)是/ ,這樣直接通過(guò)http://ip:port/就可以訪問(wèn)到index頁(yè)面,如果要修改為http://ip:port/path/ 訪問(wèn)的話,那么需要在Application.properties文件中加入server.context-path = /你的path,比如:spring-boot,那么訪問(wèn)地址就是http://ip:port/spring-boot 路徑。

server.context-path=/spring-boot

常用配置:

########################################################
###EMBEDDED SERVER CONFIGURATION (ServerProperties)
########################################################
#server.port=8080
#server.address= # bind to a specific NIC
#server.session-timeout= # session timeout in seconds
#the context path, defaults to '/'
#server.context-path=/spring-boot
#server.servlet-path= # the servlet path, defaults to '/'
#server.tomcat.access-log-pattern= # log pattern of the access log
#server.tomcat.access-log-enabled=false # is access logging enabled
#server.tomcat.protocol-header=x-forwarded-proto # ssl forward headers
#server.tomcat.remote-ip-header=x-forwarded-for
#server.tomcat.basedir=/tmp # base dir (usually not needed, defaults to tmp)
#server.tomcat.background-processor-delay=30; # in seconds
#server.tomcat.max-threads = 0 # number of threads in protocol handler
#server.tomcat.uri-encoding = UTF-8 # character encoding to use for URL decoding

Springboot中添加contextPath

spring boot默認(rèn)是/ ,這樣直接通過(guò)http://ip:port/就可以訪問(wèn)到index頁(yè)面,如果要修改為http://ip:port/path/ 訪問(wèn)的話,那么需要在Application.properties文件中加入server.context-path= /你的path,比如:spring-boot,那么訪問(wèn)地址就是http://ip:port/spring-boot路徑。

profile配置

server.context-path=/spring-boot
server
? ? ?context-apth: /spring-boot

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • Java 批量獲取地址間距離工具(支持中轉(zhuǎn)站)

    Java 批量獲取地址間距離工具(支持中轉(zhuǎn)站)

    本文主要介紹了Java批量獲取地址間距離,獲取兩個(gè)地址間距離,實(shí)現(xiàn)方式比較多,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-07-07
  • 深入了解Java行為型設(shè)計(jì)模式之策略模式

    深入了解Java行為型設(shè)計(jì)模式之策略模式

    策略模式屬于Java-設(shè)計(jì)模式中行為模式之一,該模式定義了一系列算法,并將每個(gè)算法封裝起來(lái),使它們可以相互替換。本文將通過(guò)示例詳細(xì)講解這一模式,需要的可以參考一下
    2022-09-09
  • Spring 緩存抽象示例詳解

    Spring 緩存抽象示例詳解

    Spring框架自身并沒(méi)有實(shí)現(xiàn)緩存解決方案,但是從3.1開(kāi)始定義了org.springframework.cache.Cache和org.springframework.cache.CacheManager接口,提供對(duì)緩存功能的聲明,能夠與多種流行的緩存實(shí)現(xiàn)集成。這篇文章主要介紹了Spring 緩存抽象 ,需要的朋友可以參考下
    2018-09-09
  • Springboot?接口需要接收參數(shù)類型是數(shù)組問(wèn)題

    Springboot?接口需要接收參數(shù)類型是數(shù)組問(wèn)題

    這篇文章主要介紹了Springboot?接口需要接收參數(shù)類型是數(shù)組問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-01-01
  • Java設(shè)計(jì)模式之java狀態(tài)模式詳解

    Java設(shè)計(jì)模式之java狀態(tài)模式詳解

    這篇文章主要介紹了Java設(shè)計(jì)模式之狀態(tài)模式定義與用法,結(jié)合具體實(shí)例形式詳細(xì)分析了Java狀態(tài)模式的概念、原理、定義及相關(guān)操作技巧,需要的朋友可以參考下
    2021-09-09
  • 淺談JMeter engine啟動(dòng)原理

    淺談JMeter engine啟動(dòng)原理

    本文主要介紹jmeter在控制臺(tái)在點(diǎn)擊執(zhí)行之后底層所做的一些主要事情及內(nèi)容,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-09-09
  • Java AOP知識(shí)詳細(xì)介紹

    Java AOP知識(shí)詳細(xì)介紹

    這篇文章主要介紹了Java AOP知識(shí)詳細(xì)介紹的相關(guān)資料,需要的朋友可以參考下
    2017-01-01
  • 淺談Java開(kāi)發(fā)中的安全編碼問(wèn)題

    淺談Java開(kāi)發(fā)中的安全編碼問(wèn)題

    這篇文章主要介紹了淺談Java開(kāi)發(fā)中的安全編碼問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2020-10-10
  • MyBatis二級(jí)緩存實(shí)現(xiàn)關(guān)聯(lián)刷新

    MyBatis二級(jí)緩存實(shí)現(xiàn)關(guān)聯(lián)刷新

    本文主要介紹了MyBatis二級(jí)緩存實(shí)現(xiàn)關(guān)聯(lián)刷新,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2023-01-01
  • SpringCloud 服務(wù)負(fù)載均衡和調(diào)用 Ribbon、OpenFeign的方法

    SpringCloud 服務(wù)負(fù)載均衡和調(diào)用 Ribbon、OpenFeign的方法

    這篇文章主要介紹了SpringCloud 服務(wù)負(fù)載均衡和調(diào)用 Ribbon、OpenFeign的方法,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-09-09

最新評(píng)論