(1)
<logic:iterate id="choice" name="choicesForm" property="choices">
<tr>
<td><bean:write name="choice" property="key"/></td>
<td><bean:write name="choice" property="name"/></td>
<bean:define id="choiceKey" name="choice" property="key" />
<td><html:image src="delete.gif" value="<%= "delete_" + choiceKey %>" /></td>
</tr>
</logic:iterate>
the problem is the required additional <bean:define> that I would like to avoid. Trying
(2)
<logic:iterate id="choice" name="choicesForm" property="choices">
<tr>
<td><bean:write name="choice" property="key"/></td>
<td><bean:write name="choice" property="name"/></td>
<td><html:image src="delete.gif" value="<%= "delete_" + choice.getKey() %>" /></td>
</tr>
</logic:iterate>
just results in
org.apache.jasper.JasperException: Unable to compile class for JSP
3\server\default\work\MainEngine\localhost\struts-helloworld\pages\jannen\listChoices_jsp.java:200: cannot resolve symbol
[javac] symbol : method getKey ()
[javac] location: class java.lang.Object
[javac] _jspx_th_html_image_2.setValue( "delete_" + choice.getKey() );
since choice is Object... Adding the correct cast results in horrible
<td><html:image src="delete.gif" value="<%= "delete_" + ((com.someCompany.someProject.somePackage.Choice)choice).getKey() %>" /></td>
I guess I could improve on that by adding some imports to have this
<td><html:image src="delete.gif" value="<%= "delete_" + ((Choice)choice).getKey() %>" /></td>
but then I am left with the task of updating the imports on JSP pages and I feel that there could/should be a simpler way. Any ideas? Unfortunately JSP 2.0 is not an option for me at the moment.
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]