작성
·
155
2
public class BookInfoDTO { private String mBookName;
private String mAuthor;
private String mGenre;
public String getmBookName() {
return mBookName;
}
public void setmBookName(String mBookName) {
this.mBookName = mBookName;
}
public String getmAuthor() {
return mAuthor;
}
public void setmAuthor(String mAuthor) {
this.mAuthor = mAuthor;
}
public String getmGenre() {
return mGenre;
}
public void setmGenre(String mGenre) {
this.mGenre = mGenre;
}
public BookInfoDTO(String mBookName, String mAuthor, String mGenre) {
super();
this.mBookName = mBookName;
this.mAuthor = mAuthor;
this.mGenre = mGenre;
}
public BookInfoDTO() {
}
}
이런 경우는 xml에 어떻게 해야 할까요??
답변 1
0
<bean id="BookInfoDTO" class="(클래스경로)">
<!--(3인자)생성자(파라미터 순서 지켜야함)-->
<constructor-arg value="(mBookName으로 넣으실값)"></constructor>
<constructor-arg value="(mAuthor으로 넣으실값)"></constructor>
<constructor-arg value="(mGenre으로 넣으실값)"></constructor>
<!--setter-->
<property name="mBookName" value="(넣으실 값)"/>
<property name="mAuthor" value="(넣으실 값)"/>
<property name="mGenre" value="(넣으실 값)"/>
</bean>
일 듯 싶습니다