Dab tsi yog Qhov Chaw Tso Khoom Hauv Caij Nplooj Ntoos Hlav?
Dab tsi yog Qhov Chaw Tso Khoom Hauv Caij Nplooj Ntoos Hlav?

Video: Dab tsi yog Qhov Chaw Tso Khoom Hauv Caij Nplooj Ntoos Hlav?

Video: Dab tsi yog Qhov Chaw Tso Khoom Hauv Caij Nplooj Ntoos Hlav?
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla use for? 2024, Plaub Hlis Ntuj
Anonim

Caij nplooj ntoos hlav ntsiab lus: vaj tse - qhov chaw . Cov ntsiab lus: vaj tse - qhov chaw tag yog siv rau externalize khoom nyob rau hauv ib daim ntawv cais. Nws cia li configures PropertyPlaceholderConfigurer , uas hloov cov ${} placeholder, uas tau daws tawm tsam ib qho kev teev tseg khoom file (as a Caij nplooj ntoos hlav qhov chaw muab kev pab).

Tom qab ntawd, ib tug kuj yuav nug, dab tsi yog cov ntaub ntawv hauv lub caij nplooj ntoos hlav?

cov ntaub ntawv tsis muaj dab tsi ntau tshaj qhov yooj yim-tus nqi cia rau kev teeb tsa khoom . Koj tuaj yeem ntim cov kev teeb tsa ntaub ntawv hauv koj lub thawv ntawv thov los yog muab tso rau ntaub ntawv nyob rau hauv lub filesystem ntawm lub sij hawm ib puag ncig thiab thauj nws rau Caij nplooj ntoos hlav Boot pib.

Tsis tas li ntawd, nyeem cov ntaub ntawv li cas thaum caij nplooj ntoos hlav? Nyeem cov ntaub ntawv khoom hauv Caij Nplooj Hlav siv XML configuration Tom qab ntawd koj tuaj yeem siv ${ vaj tse key} placeholder hauv kev txhais. Txhawm rau daws cov chaw tso cai no koj yuav tsum sau npe rau PropertySourcesPlaceholderConfigurer. Qhov no tshwm sim tau txais thaum siv <context: vaj tse -placeholder> hauv XML.

Ntawm no, kev siv PropertyPlaceholderConfigurer nyob rau lub caij nplooj ntoo hlav yog dab tsi?

Cov PropertyPlaceholderConfigurer yog ib qho cuab yeej cuab tam configurer uas daws qhov chaw nyob hauv cov khoom vaj tse taum ntawm cov ntsiab lus txhais. Nws rub cov txiaj ntsig los ntawm cov ntaub ntawv cov khoom rau hauv cov ntsiab lus taum.

Dab tsi yog ib puag ncig abstraction nyob rau lub caij nplooj ntoos hlav?

Cov Environment abstraction nyob rau lub caij nplooj ntoos hlav sawv cev rau ib puag ncig uas tam sim no daim ntawv thov yog khiav. Nyob rau lub sijhawm no, nws zoo li koom ua ke txoj hauv kev nkag mus rau cov cuab yeej hauv ntau yam khoom ntiag tug, xws li cov ntaub ntawv khoom, JVM cov khoom siv, cov kab ke. ib puag ncig variables, thiab servlet ntsiab lus parameters.

Pom zoo: