-1
ArrayList 요소를 반복하고 목록 요소를 업데이트 한 다음 저장하고 싶습니다. ID 속성의Struts 1.2 - ArrayList 표시 및 업데이트
My Form Bean:
MyTestCodeForm.java - it have two members id and ArrayList.
String id;
ArrayList<Book> listBook;
getter 및 setter이에서 getter와
public void setListBook(ArrayList<Book> bookList)
{
this.listBook = bookList;
}
public ArrayList<Book> getListBook()
{
return this.listBook;
}
Book.java have two members
String bookId;
String bookName;
Action class - MyTestCodeAction.java
ArrayList를
의 호텔은, 내가 데이터를 얻을 데이터베이스에 저장합니다. 반복하는 대한내 JSP 페이지 :
<nested:nest property='myTestCodeForm'>
<html:form action='/myTestCodeForm'>
<nested:write name='' property='id'/>
<html:hidden name='' property='id'/>
<nested:iterate id='foo' name='' property='bookList'>
<html:text name='foo' property='bookName' indexd='true'/>
</nested:iterate>
<html:submit value='submit'/>
</html:form>
</nested:nest>
내 질문은, 내가 성공적으로 데이터를 반복하지만 난 액션 클래스에 데이터를 얻을 때 나는 배열 목록 데이터를 수신하지 않았다하지만 난 id 속성을 받았다.
도와주세요
Abhijeet, 당신은 나에게 빈 값을 설정하려고하는 대상 클래스에 대한 코드를 보여 주 시겠어요, 또한-config.xml에 스트럿, 난 당신이하지 생각 : 자, 내 양식 콩은 다음과 같이 모델 속성을 올바르게 구성합니다. –
답장을 보내 주셔서 감사합니다.하지만 제 솔루션이 있습니다. 솔루션을 참조하십시오. –