Hello there. I have the following problem in Struts 2.
Let's assume i have a class like this
class User {
private String name;
private String address;
public String getName() { return name;}
public String getAddress() { return address;}
}
and a list of users available on ValueStack named : users and a list of user propertiesavailable also on ValueStack as: userProps. In this case userProps would be {name, address}.
Now I want to iterate over the users list and dinamycally access one user properties via userProps.
Here is how:
<s:iterator value="#users" var="user">
<s:iterator value="#userProps" var="prop">
**<%--- HOW to get user.name, user.address ???%>**
<s:property value="#user.%{#prop}"/>
</s:iterator>
</s:iterator>
I dont know how to evaluate #user.#data to obtain the value for #user.name or #user.address ??
Thank you.