2013-11-25 3 views
0

에서 ArrayList에 데이터를 가져 오는 방법이 JSP는 JSP

내가 N 항목에 하나를 포함 할 수있는 데이터를 가져 오기 할
<form action="submit"> 
    <tr class="row" id="item1"> 
    <td><input type="text" name="type" class="type" style="width: 50px"/></td> 
    <td><input type="text" name="color" class="color" style="width: 50px"/></td> 
    <td><input type="text" name="qty" class="qty" style="width: 50px"/></td> 
    <td><input type="text" name="unitprice" class="unitPrice" style="width: 50px"/></td> 
</tr> 

... 
<tr class="row" id="itemN"> 
    <td><input type="text" name="type" class="type" style="width: 50px"/></td> 
    <td><input type="text" name="color" class="color" style="width: 50px"/></td> 
    <td><input type="text" name="qty" class="qty" style="width: 50px"/></td> 
    <td><input type="text" name="unitprice" class="unitPrice" style="width: 50px"/></td> 
</tr> 

</form> 

에서 내 양식이며, 각 항목 typecolorqtyunitprice을 contais. 이 모든 데이터를 ArrayList 변수에 저장하려고합니다. 이 작업을 수행하는 방법? 당신이 필요로하는 무엇

+0

입니다. –

+0

XWork가 임포트 오류를 ​​나타냅니다. import com.atlassian.confluence.core.ConfluenceActionSupport'; – xrcwrn

답변

1

유형 변환이 그 일을한다 XWork 일반적으로 Tabular Input

+0

전혀 다른 설명이 없다. – xrcwrn

+0

당신이 이해하지 못했던 것. 기본적으로 빈을 반복해야합니다. 예를 들어 Bean (이름을 Product로 지정)이 있고 속성이 color qty 및 unitprice 인 경우와 같습니다. 따라서 개별 속성을 설정하는 대신 Product 빈 목록을 만든 다음 해당 목록을 반복하고 점 표기법을 사용하여 JSP에서 값을 설정합니다. 예 :'' –

+0

jsp tp arraylist에서만 값을 가져와야합니다. – xrcwrn