Greetings from Indiana!
I need a little help. I have a
struts form:
<html:text size="8" maxlength="8" property="workStart[0]" />
<html:text size="8" maxlength="8" property="workEnd[0]" />
<html:text size="8" maxlength="8" property="workStart[1]" />
<html:text size="8" maxlength="8" property="workEnd[1]" />
<html:text size="8" maxlength="8" property="workStart[2]" />
<html:text size="8" maxlength="8" property="workEnd[2]" />
I also have an ActionForm:
private
String [] workStart;
private String [] workEnd;
public String [] getWorkStart() {
return workStart;
}
public void setWorkStart(String workStart, int index) {
this.workStart[index] = workStart;
}
public String [] getWorkEnd() {
return workEnd;
}
public void setWorkEnd(String workEnd, int index) {
this.workEnd[index] = workEnd;
}
And, yes, I even have an ActionClass with an action forward function containing:
ScheduleForm f = (ScheduleForm) form;
request.setAttribute("WorkStart", f.getWorkStart());
request.setAttribute("WorkEnd", f.getWorkEnd());
return mapping.findForward("show");
Finally, I have a
jsp page with the following code,
String [] x = (String []) request.getAttribute("WorkStart");
out.println(x);
-----------------------------------------------------------------------------------
I get a null output, I cannot figure out what I am doing wrong. I am missing something when dealing with arrays and forms and I am not quite sure what it can be. I think it may be my setter functions, because I am getting null, which leads me to believe the ActionForm is not getting populated.
Anyone have an idea's, or know how to accomplish what I am trying to get done?
Thanks for any help!!!
Tim