java - Accessing Map attribute with dynamic key in Struts 2 OGNL -


i have list of strings attribute names , map. i'm trying access model(ex.project) in map using attribute name in string list.

here have now.

<s:iterator value="themap" var="element">   <tr>     <s:iterator value="attributelist" var="attrname">       <td><p><s:property value="#element.project.#attrname" /></p></td>     </s:iterator>   </tr> </s:iterator> 

if hard code attribute name works fine:

<td><p><s:property value="#element.project.projectname" /></p></td> 

any advice appreciated.

using ognl <s:property value="#element.project[#attrname]" />


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -