Ok, I have a form bean that represents the
jsp form. The jsp form has a table that is built using the iterate tag and iterating through an array list of a bean. So far so good, the data displays fine. Now, how do I reverse it? I want to be able to get at this "list" that is present on the jsp page IN my action class. Here is some of the code basics.
If this isnt clear enough, please ask questions and I will try to explain. In a nutshell I want to get the value of a table out of a jsp page and into my action
Mike
public class AwardMasResultsForm extends ActionForm {
// The search field
private ArrayList awards; //this is put into the jsp iterate loop
public void setAwards(ArrayList awdList) {
this.awards = awdList;
}
public ArrayList getAwards() {
return this.awards;
}
public ActionForward filter( ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
AwardSearchService service = new AwardSearchService();
ArrayList awards = service.getAwardMasView( awardCodeView.getAwdCode() );
//I put the list into the form
((AwardMasResultsForm)form).setAwards(awards);
}
now in an effort to get the value back out I have ...
public class CrudAwardsAction extends Action {
public ActionForward execute( ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
//I want to get the values from the jsp page here
ArrayList awards = ((AwardMasResultsForm)form).getAwards();
Iterator i = awards.iterator(); //
while (i.hasNext()) {
AwardMasView awardmas = (AwardMasView)i.next();
System.out.println(awardmas.getSafAwardCode());
}