You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Oliver Thiel <th...@gmx.de> on 2003/12/27 17:05:46 UTC

bean:write AND logic:iterate

Hi @ll;
 
 
In my Form I define an Array, which contains some message resource keys.
I'm able to print out the values,
but what I want to archive is that it prints out the value from the
application resource properties and also I 
wanted to use an logic:iterate to print them out, so it should be
something like that:
 
<logic:iterate id=" keyAry " name=" keyAry ">
<tr align="left">
<td>
<bean:message key="<bean:write name=" keyAry" property=" keyIndexed" />
"/
</td>
</logic:iterate>
  
 
Thanks
Oliver
 
What works so far:
 
IndexedFom.java
 
private String keyAry[]   = { "form.uid", "form.email", "form.password",
"form.conf_pwd", "form.getEmail"};
 
    public String getKeyIndexed(int index) { 
        return keyAry[index]; 
    }
    
    public void setKeyIndexed(int index, String value) { 
        keyAry[index] = value; 
    }
 
 
indexedFom.jsp
 
<jsp:useBean id="keyAry" class="struts.form.indexedForm"/>
<bean:write name=" keyAry" property="keyIndexed[1]"/><br>
 
 
RESULT:             form.email