Thursday, August 16, 2012

How to view List inside list using

if you have a list inside another list, for example you want to iterate over students list and students courses 
and you want to view it in the jsp page, you can use the <s:iterator>  as follows: 

<s:iterator value="studentsList" >

        <s:property value="studentName"/>

       <s:iterator value="%{courses}" >

                      <s:property value="courseName"/>

       </s:iterator> 

</s:iterator> 


This example read the studentsList from struts action. 

No comments:

Post a Comment