Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I am unable to form table in List<String> using struts 2 tags
- public class IteratorAction extends ActionSupport{
- private List<String> list;
- public List<String> getList() {
- return list;
- }
- public void setlist(List<String> list) {
- this.list= list;
- }
- public String execute() {
- list= new ArrayList<String>();
- list.add("A");
- list.add("B");
- list.add("C");
- list.add("D");
- list.add("E");
- list.add("F");
- return SUCCESS;
- }
- }
- <table>
- <s:iterator value="list" status="listStatus">
- <tr>
- <s:if test="#listStatus.even == true">
- <td style="background: #CCCCCC"><s:property/></td>
- </s:if>
- <s:elseif test="#listStatus.first == true">
- <td><s:property/> (This is first value) </td>
- </s:elseif>
- <s:else>
- <td><s:property/></td>
- </s:else>
- </tr>
- </s:iterator>
- </table>
Add Comment
Please, Sign In to add comment