在web-application-config.xml中定義
<bean id="employeeServiceDest" class="com.service.EmployeeServiceImpl">
<flex:remoting-destination />
<property name="EsysDao" ref="EsysDao"/>
</bean>
結果,運行時出錯:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeServiceDest' defined in ServletContext resource [/WEB-INF/web-application-config.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'esyerDao' of bean class [com.service.EmployeeServiceImpl]:
Bean property 'esyerDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
個人理解spring中的bean標籤用來給類創建對象,property相當於類中的屬性,如果類要使用屬性的話,需要在該類中生成get和set方法,否則會報錯。