Java Tutorial/Spring/Properties File

Материал из Java эксперт
Перейти к: навигация, поиск

IOC With Properties File

File: context.properties



source.(class)=SimpleMessageData
destination.(class)=StdoutMessageReporter
service.(class)=DefaultMessageService
service.source(ref)=source
service.destination(ref)=destination





Properties File Based Spring Bean

File: helloworld-context.properties



source.(class)=SimpleMessageData
destination.(class)=StdoutMessageReporter





Property File based Bean Injection

File: context.properties



oracle.(class)=BookwormOracle
encyclopedia.(class)=HardcodedEncyclopedia
oracle.encyclopedia(ref)=encyclopedia





Spring Properties File Base Data Injection

File: helloworld-context.properties



source.(class)=SimpleMessageData
destination.(class)=StdoutMessageReporter
service.(class)=DefaultMessageService
service.source(ref)=source
service.destination(ref)=destination