This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem using EL in html:button onclick" Watch "problem using EL in html:button onclick" New topic

problem using EL in html:button onclick

Stas Shvabsky

Joined: Feb 02, 2007
Posts: 5

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(){

public void setEmail(String email){ = email;

... etc ...

I initialize array in DispatchAction


then I iterate trought the email collection

<logic:iterate id="address" property="emails">
<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

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
Have you checked out Aspose?
subject: problem using EL in html:button onclick
It's not a secret anymore!