struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Bergeron" <>
Subject RE: Form tags
Date Thu, 08 Mar 2001 01:38:49 GMT
Does anyone have any ideas about this?

-----Original Message-----
From: Brian Knorr []
Sent: Tuesday, March 06, 2001 12:16 PM
Subject: struts -- Form tags


Hi... I was wondering if you ever heard anything back from the struts user
group on the "Form tags" issue you posted?  I was wondering the exact same
thing... especially for radio buttons.


Brian Knorr

NextJet! the leader in same day delivery.

-----Original Message-----
From: Ted Bergeron []
Sent: Wednesday, February 28, 2001 5:28 PM
To: Struts-User
Subject: Form tags

I'm wondering about the logic behind the form tags.  Here I have a simple
form that is created by iterating over a collection.  The iterator exposes
the variable "item" which is a String for this simple case.  The name
attribute of bean:write treats "item" as a variable, while the value
attribute of various form tags (radio, text, hidden) treats "item" as a
literal.  Thus, the "<%= item %>" workaround.  This workaround leads to code
that is not well formed xml, and becomes much uglier with a collection of
complex objects.

Am I using the framework incorrectly? Is this an oversight/bug?  Is this a
necessary behavior?

Thanks for the help,


<%    java.util.ArrayList list = new java.util.ArrayList();
    pageContext.setAttribute("list", list, PageContext.PAGE_SCOPE);

<html:form action="/">
<logic:iterate id="item" name="list" type="java.lang.String">
    <td><html:radio property="username" value="item"/></td>

    <td><html:radio property="username" value="<%= item %>"/></td>

    <td><bean:write name="item"/></td>

View raw message