wood burning stoves 2.0*
The moose likes Spring and the fly likes Spring MVC AbstractWizardFormController: Cannot see ArrayList populated in controller Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring MVC AbstractWizardFormController: Cannot see ArrayList populated in controller" Watch "Spring MVC AbstractWizardFormController: Cannot see ArrayList populated in controller" New topic
Author

Spring MVC AbstractWizardFormController: Cannot see ArrayList populated in controller

raul fernandez
Greenhorn

Joined: Nov 04, 2011
Posts: 2
I have a file collection control class, which I populate in the formBackingObject of the controller. The fromDate and toDate attributes of the object get populated in the view, but I cannot see the poFileList ArrayList property that I populated from the controller. Can anyone help?

Thanks

<table border="1">
<form:form method="post">
<tr>
<td>
<table><tr>
<td>Date from [mm/dd/yyyy]: </td><td><form:input path="fromDate"/></td>
<td>Date to [mm/dd/yyyy]: </td><td><form:input path="toDate"/></td>
</tr>
</table>
<input type="submit" value="Next" name="_target1">
</td>
</tr>
<c:forEach items="${poFileList}" var="myfile">
<tr><td><cut value="${myfile.name}"/></td></tr>
</c:forEach>
</form:form>
</table>

-----------------------------------------

public class PoFileController extends AbstractWizardFormController {

...

@Override
protected Object formBackingObject(HttpServletRequest request) throws Exception {

PoFileCollection defaultPoFileColl = new PoFileCollection();
defaultPoFileColl.setFromDate("11-04-2011");
defaultPoFileColl.setToDate("11-05-2011");

List<PoFile> poFileList = new ArrayList<PoFile>();
PoFile poFile1 = new PoFile();
poFile1.setName("filetest1");
poFileList.add(poFile1);
PoFile poFile2 = new PoFile();
poFile1.setName("filetest2");
poFileList.add(poFile2);
defaultPoFileColl.setPoFileList(poFileList);
return defaultPoFileColl;
}


-----------------------------------------

public class PoFileCollection {

private String fromDate;
private String toDate;
private List<PoFile> poFileList;
private String collReference;
private List<PoFile> poFiles;

public String getFromDate() {
return fromDate;
}
public void setFromDate(String fromDate) {
this.fromDate = fromDate;
}
public String getToDate() {
return toDate;
}
public void setToDate(String toDate) {
this.toDate = toDate;
}
public List<PoFile> getPoFileList() {
return poFileList;
}
public void setPoFileList(List<PoFile> poFileList) {
this.poFileList = poFileList;
}

}


package com.fiftyone.webpstoolkit.model;

public class PoFile {

private String name;
private boolean downloadFlag;
private boolean decryptFlag;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public boolean isDownloadFlag() {
return downloadFlag;
}

public void setDownloadFlag(boolean downloadFlag) {
this.downloadFlag = downloadFlag;
}

public boolean isDecryptFlag() {
return decryptFlag;
}

public void setDecryptFlag(boolean decryptFlag) {
this.decryptFlag = decryptFlag;
}

}
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

This should help : http://mattfleming.com/node/134


===Vyas Sanzgiri===
My Blog
raul fernandez
Greenhorn

Joined: Nov 04, 2011
Posts: 2
Thanks Vyas, I will try that.

Raul
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring MVC AbstractWizardFormController: Cannot see ArrayList populated in controller