I have some
java code in a
jsp page that I want to change to use the
Struts logic:iterate instead of the for loop.
Can someone pls. help me? I tried using the logic:iterate, but didn't know how to set the values. My code is shown below:
---------------------------------------------------
<%@ page import="mypkg.*" %>
<%
// get the productobject put to request from previous jsp's viewAction
// and get the individual field values.
myObject myobj= (myObject) request.getAttribute("productobj");
String p_id = myobj.getPid();
String time = myobj.getTime();
String product= myobj.getProduct();
String price= myobj.getPrice();
String imgreq = myobj.getImage();
System.out.println("img in jsp is " + imgreq);
%>
-------------------------------------------
I'm pre-populating my form with the above values.. for editing functionality... based on the value returned by getImage() - [which is either "Y" or "N"], I have to set the appropriate radio button. With the above code, all my fields are populated with dynamic data except the radio button. This doesn't get set.
Is there any way, I can set the radio button without changing the code to logic:iterate? All related documents that I found on the net points to the use of logic:iterate. But I'm unable to set my values using this.
Thanks,
Kate