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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -