I am new to struts(and somewhat new to Java).
I am trying to extract my data out of a string array onto
a JSP confirmation page.
😕 Can someone tell me how to get the correct results(values) from my collection?
I have copied the relevant code:
CaseService Module:
String writeOff=null;
String osi=null;
String taxReporting=null;
if (rs.getInt("writeOff")==1){writeOff="writeOff";}
if (rs.getInt("osi")==1){osi="osi";}
if (rs.getInt("taxReporting")==1)
{taxReporting="taxReporting";}
String[] selectedStatusValues={writeOff,osi,taxReporting};
dto.setSelectedStatus(selectedStatusValues);
caseRecordAction(Dispatch Action) :
dto.getSelectedStatus();
request.setAttribute("selectedStatus",selections);
return mapping.findForward("showDeleteConfirm");
JSP:
Case Events
<logic:iterate id="items" name="selectedStatus">
<bean:write name="selectedStatus"/>
</logic:iterate>
Page Results:
Case Events
[Ljava.lang.String;@1c948cb
[Ljava.lang.String;@1c948cb
[Ljava.lang.String;@1c948cb
if I try the following I get an error that can’t find
bean “items”:
Case Events
<logic:iterate id="items" name="selectedStatus">
<bean:write name="items"/>
</logic:iterate>