08.값형식di
값 형식 DI
- 값 형식의 속성에 값 설정하기
값형식으로 주고 싶을떄
<bean id="exam" class="spring.di.entity.NewlecExam" >
<property name = "kor" value = "10"/>
</bean>
위에 같이 주면 에러가 발생한다
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'kor' of bean class [spring.di.entity.NewlecExam]: Bean property 'kor' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
kor을 세팅 할 수있는 것이 없다 -> setter을 생성해준다
중첩된 태그 사용하기
<bean id="exam" class="spring.di.entity.NewlecExam" >
<property name = "Kor" ><value>10</value></property>
</bean>
중첩한 태그를 사용해도 동일한 값이 나온다
댓글남기기