how to use tag for Collections


Web tier: servlets, JSP, Web frameworks: how to use tag for Collections

  1. how to use tag for Collections (2 messages)

    Hello, I want to display contents of a Collection via a tag. The collection is itself a list of ArrayLists and each ArrayList has 3 Strings in it. I am not sure how to iterate through the Collection? This is how I am populating my Collection. --------------------------------------------------------- public Collection retrieveSQL() throws SQLException { Collection coll = new java.util.Vector(); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM t"); while ( { java.util.ArrayList arr = new java.util.ArrayList(); arr.add(rs.getString(1)); arr.add(rs.getString(2)); arr.add(rs.getString(3)); coll.add(arr); } return coll; } -------------------------------------------------------- Your help is appreciated! :)
  2. Re: how to use tag for Collections[ Go to top ]

    Dear Ali, Keep ur list in request.Like req.setAttribute("stafflist",staffdetails); then set that list in logic:iterate like below example... hope this helps u. regards Subhashree
  3. hi i am using tiles in my problem is every time page refreshing when click on a to avoid this.