- This topic has 3 replies, 2 voices, and was last updated 19 years, 2 months ago by Riyad Kalla.
-
AuthorPosts
-
jcasualMemberI 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>
Riyad KallaMemberif I try the following I get an error that can’t find
bean “items”:This second snippet of code is actually the correct way, have you tried usign collection attribute instead of selectedStatus?
jcasualMemberI’m not sure I undstand your question. but I used the same property(selectedStatus) for a multibox control on my form. It works just fine. Since multibox can only accept a String array I thought the iterator would work for selectedStatus on the delete confirmation form. Is this not the case? I welcome any alternative solutions. Thanks for your responses.
Riyad KallaMemberTry asking the Struts mailing list, I’m really rusty on my Struts right now and I know the specifics ofthe tags can be tricky to remember how they need to be configured.
-
AuthorPosts