This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes problem using EL in html:button onclick Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem using EL in html:button onclick" Watch "problem using EL in html:button onclick" New topic
Author

problem using EL in html:button onclick

Stas Shvabsky
Greenhorn

Joined: Feb 02, 2007
Posts: 5
Hi

I have an Action Form with the following code

private String[] emails = null;
private String email = null;

public void setEmails(String[] emails){
this.emails = emails;
}

public String[] getEmails(){
return this.emails;
}

public String getEmail(){
return this.email;
}

public void setEmail(String email){
this.email = email;
}

... etc ...

I initialize array in DispatchAction

form.setEmails(user.getUserEmails());


then I iterate trought the email collection

<logic:iterate id="address" property="emails">
<tr>
<td><bean:write name="address"/></td>
<td><html:hidden property="email" value="<bean:write name='address'/>"/>

last row does not converts to value of address instead of it prints the same row in encoded mode like:
<input type="hidden" name="email" value="<bean:write name='address'/>">

what am I doing wrong?
Stas Shvabsky
Greenhorn

Joined: Feb 02, 2007
Posts: 5
I found a way around. Now I use regular <input type="hidden" value="<bean:write name='address'/>">
It works.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I see you found your "solution", but I can't quite figure out what you were trying to do. It looks like your form has a single String property named email but now your html page is going to have multiple hidden fields with the property name email.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem using EL in html:button onclick