1
Memahami kelas semi @Configuration
Mengikuti pertanyaan Memahami Penggunaan Spring @Autowired Saya ingin membuat basis pengetahuan lengkap untuk opsi lain kabel pegas, @Configurationkelas. Anggaplah saya memiliki file XML pegas yang terlihat seperti ini: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <import resource="another-application-context.xml"/> <bean id="someBean" class="stack.overflow.spring.configuration.SomeClassImpl"> <constructor-arg value="${some.interesting.property}" /> </bean> <bean id="anotherBean" class="stack.overflow.spring.configuration.AnotherClassImpl"> <constructor-arg ref="someBean"/> …