If you're using Struts 2 use the webwork Iteration tags <ww:iterator /> Iterates over a collection. <ww:generator /> Generates iterators. <ww:append /> Appends several iterators. <ww:subset /> Gets a subset of an iterator. <ww:merge /> Merges several iterators into one. <ww:sort /> Sorts an iterator
http://cwiki.apache.org/WW/tutoriallesson04-01.html ? Martin ----- Original Message ----- From: "Ylva D" <[EMAIL PROTECTED]> To: <user@struts.apache.org> Sent: Tuesday, July 29, 2008 2:16 PM Subject: Possible to iterate through a java.util.Set using Struts 1? > > Hi everyone! > > I've just started learning Struts (1) and this is my current problem: > I have a java.util.Set which is saved in the current session and I'm trying > to use Struts for checking if it's not empty and in that case iterating > through it (from a JSP). This is the beginning of that code: > > <logic:notEmpty scope = "session" name = "skillsFound"> > <logic:iterate collection = "skillsFound" id= "thisSkill" scope > = "session"> > > When I try stepping through the code, the logic:notEmpty tag is handled just > fine, but when I get to the logic:iterate tag I get this exception: > > javax.servlet.jsp.JspException: Cannot create iterator for this collection > > Does anyone know if it's possible to iterate through a Set using Struts (1 > and not 2) in any way? > > I could always make it work by writing a scriptlet and iterate through it > the regular Java way, but I'm trying to use as much Struts as possible since > I'm doing a thesis where one of the issues is what the benefits of Struts > are. (And besides, I've read that using scriptlets is "bad style" nowadays.) > > So if anybody knows a Struts solution to this, I'd be very grateful! > > Thanks in advance! > > /Ylva > -- > View this message in context: > http://www.nabble.com/Possible-to-iterate-through-a-java.util.Set-using-Struts-1--tp18718294p18718294.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >