I am using Struts 1.2 for my application. I need to iterarte through a List and create <html:radio> based on the number of items present in the list. For iterating through the List, I am using <logic:iterator>. The list is set as an attribute to the request.
This is the code I am using:
<logic:iterate name="mediaTypes" id="type">
<html:radio name="rentMediaForm" property="mediaType" value="type"></html:radio>
<bean:write name="type"/>
</logic:iterate>
But every time the values of the radio is getting assigned to “type”. I want the value to be dynamic based on the iteration value.
I am getting the value properly in the below line:
<bean:write name="type"/>
Please let me know how to achieve this.
Regards,
Use the EL (expression language) to get the value of
type, e.g.:Also note, that your application should be at least of Servlet 2.4/JSP 2.0 level in order to be able seamlessly process EL expressions. Otherwise, you might need to switch to EL-aware version of struts-html tags.