jsp - Display contents of a list of beans with struts2-iterator -


i´m trying display list constains objets of bean. i´m using iterator tag display list

/*jsp*/ <s:iterator value="linftaq" var="res"> <tr>     <td><s:property value="#res.numejercicio"/></td>     <td><s:property value="#res.numoks()"/></td>     <td><s:property value="#res.numkos"/></td> </tr> </s:iterator>   /*action*/ public class taquitoscopioaction extends actionsupport{  /* . . . */ list <informetaquitoscopio> linftaq; /* filled list */   /*bean*/ public class informetaquitoscopio { private string numejercicio; private string numoks; private string numkos; public informetaquitoscopio() {   super();   // todo auto-generated constructor stub } public informetaquitoscopio(string numejercicio, string numoks, string numkos) { super(); this.numejercicio = numejercicio; this.numoks = numoks; this.numkos = numkos; } /*getters , setters*/ } 

but jsp doesn´t display anything. whats wrong?

informetaquitoscopio must have getters for: numejercicio, numoks, numkos or make properties public. action requires getter linftaq or property public.

then following should work:

<s:iterator value="linftaq"> <tr>     <td><s:property value="numejercicio"/></td>     <td><s:property value="numoks"/></td>     <td><s:property value="numkos"/></td> </tr> </s:iterator> 

just speaking tend not var attributes on struts2 tags. tell me going covering variable or moving scope. if not nesting iterators shouldn't need var attribute on iterator. easier on eyes way. assuming understand you're working stack, pretty fundamental struts2.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -