J
javaguy44
I have a question about the subject above, and was wondering if anyone
can help me.
I have a DynaActionForm with the following in struts-config.xml:
<form-bean name="myDynaValidateForm"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="testiterate" type="java.lang.String[]"/>
</form-bean>
In my action class, I have a the following:
DynaValidatorForm f = (DynaValidatorForm) form;
String[] s = new String[3];
s[0] = "a";
s[1] = "b";
s[2] = "c";
f.set("testiterate", s);
Now my question is how can I display the following using logic:iterate
in my jsp?
I have done the following, and it does not work so far:
<logic:iterate id="idx" name="myDynaValidateForm">
<bean:write name="idx" property="testiterate"/>
</logic:iterate>
I would appreciate any help you can give me!
As for problem 2:
I have implemented the same part above but in a different manner.
Rather than trying to f.set("testiterate",s); I do the following in my
action form
DynaValidatorForm f = (DynaValidatorForm) form;
String[] s = new String[3];
s[0] = "a";
s[1] = "b";
s[2] = "c";
request.setAttribute("RESULTSTRING", s);
Now I can get this to display in the .jsp, but my question 2 is
this...in order to get it to display, I had to include <logicresent>
tags like so:
<logicresent name="RESULTSTRING" scope="request">
<logic:iterate id="list" name="RESULTSTRING">
<bean:write name="list"/>
</logic:iterate>
</logicresent>
I could only find one link that says I had to include <logicresent>
on the web, and I was just hoping that someone could confirm that I
had to use <logicresent>???
I am using Struts 1.1, and Tomcat 5.0.19
Thanks,
Javaguy
can help me.
I have a DynaActionForm with the following in struts-config.xml:
<form-bean name="myDynaValidateForm"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="testiterate" type="java.lang.String[]"/>
</form-bean>
In my action class, I have a the following:
DynaValidatorForm f = (DynaValidatorForm) form;
String[] s = new String[3];
s[0] = "a";
s[1] = "b";
s[2] = "c";
f.set("testiterate", s);
Now my question is how can I display the following using logic:iterate
in my jsp?
I have done the following, and it does not work so far:
<logic:iterate id="idx" name="myDynaValidateForm">
<bean:write name="idx" property="testiterate"/>
</logic:iterate>
I would appreciate any help you can give me!
As for problem 2:
I have implemented the same part above but in a different manner.
Rather than trying to f.set("testiterate",s); I do the following in my
action form
DynaValidatorForm f = (DynaValidatorForm) form;
String[] s = new String[3];
s[0] = "a";
s[1] = "b";
s[2] = "c";
request.setAttribute("RESULTSTRING", s);
Now I can get this to display in the .jsp, but my question 2 is
this...in order to get it to display, I had to include <logicresent>
tags like so:
<logicresent name="RESULTSTRING" scope="request">
<logic:iterate id="list" name="RESULTSTRING">
<bean:write name="list"/>
</logic:iterate>
</logicresent>
I could only find one link that says I had to include <logicresent>
on the web, and I was just hoping that someone could confirm that I
had to use <logicresent>???
I am using Struts 1.1, and Tomcat 5.0.19
Thanks,
Javaguy