2010-02-03 1 views
0
<table border="0" cellspacing="1" cellpadding="0" width="100%" class="boxtbl"> 
    <th rowspan="2" class="fntnrml" colspan="5">Trip ID</th> 
    <bean:write name="loan" property="tripID1" /> 
    <td><html:checkbox property="ZAXY" /></td> 
    <td><bean:write name="loan" property="Profile11" /></td> 
    <td><bean:write name="loan" property="StartDt11" /></td> 
</table> 

위의 표를 반복하는 방법은 무엇입니까? 컬렉션 만 반복 할 수 있다고 읽었습니다. 그러나 <td> 안에 "체크 박스"도 사용하고 있습니다. 수행하는 방법? 당신은 하나의 테이블을 표시하려면Struts 태그를 사용하여 JSP에서 테이블을 반복하는 방법은 무엇입니까?

답변

0

당신은 예를 들어 테이블에게 응답을

<s:iterator value="listObject"> 
<table border="0" cellspacing="1" cellpadding="0" width="100%" class="boxtbl"> 
    <th rowspan="2" class="fntnrml" colspan="5">Trip ID</th> 
    <bean:write name="loan" property="tripID1" /> 
    <td><html:checkbox property="ZAXY" /></td> 
    <td><bean:write name="loan" property="Profile11" /></td> 
    <td><bean:write name="loan" property="StartDt11" /></td> 
</table> 
</s:iterate> 
+0

감사

을 반복하는 어떤 JSTL이나 스트럿츠 태그 반복자를 사용하여 반복

하여 여러 테이블이 있습니다. .하지만 struts1 사용하고 있습니다. 그 문법은 무엇입니까? –

+0

위와 같이 사용하면 JSP에 <% @ taglib uri = "/ struts-tags"prefix = "s"%> taglib를 추가하거나 JSTL core TAG