Well I don't know if MapPropertyAccess would do what I want but found an answer:
The following iterates over a list of POJO's and the properties are determined for the particular POJO at run time and put in the propertyValues list. The following is able to look up the property value dynamically with OGNL. <h1>Print Table</h1> <table border="1"> <s:iterator value="result" var="record"> <tr> <s:iterator value="propertyValues" var="key"> <td> <s:property value="%{#record[#key]}" /> </td> </s:iterator> </tr> </s:iterator> </table> On Tue, 2011-02-01 at 15:53 -0700, Ken McWilliams wrote: > It looks like I need to use a PropertyAccessor and > ognl.MapPropertyAccessor specifically. Are there any demos in how to > use it, can one use it directly from the JSP? > > On Tue, 2011-02-01 at 15:35 -0700, Ken McWilliams wrote: > > Hello I have a list of properties from a POJO as found using > > introspection. > > > > I want to iterate over a result set for each row, and iterate over a > > list of property names for each cell in a table. > > > > Something like: > > > > <s:iterator value = "resultList"> > > <tr> > > <s:iterator value="propertyNames"> //I want propertyNames to be > > evaluated and the result used as the value for the iterator, not simply > > interpreted as a normal list. > > <s:property/> > > </s:iterator> > > </tr> > > </s:iterator> > > > > If there is no way to do this then I'll create a BeanMap out of every > > record in the result set (list of POJO's returned via JPA). > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org