日期:2014-05-17 浏览次数:21162 次
ArrayList<String> list = new ArrayList<String>();
for (int i = 0; i < files.length; i++) {
File readfile = new File(file + "/" + files[i]);
String filePath = readfile.getPath();
String fileName = filePath.substring(filePath.lastIndexOf("\\") + 1, filePath.length());
String fileDate = sdf.format(readfile.lastModified());
list.add(fileName + "|" + fileDate);
}
fileList = list;
return SUCCESS;
------解决方案--------------------
用对象,把数据封装成对象,如下,
public class Test{
private String fileName;
private String fileDate;
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileDate() {
return fileDate;
}
public void setFileDate(String fileDate) {
this.fileDate = fileDate;
}
}
------解决方案--------------------
<c:forEach items="${fileList}" var="list" vars>
<tr>
<td style="text-align: center" height="30" nowrap="nowrap" >${list[0][0]}</td>
<td style="text-align: center" height="30" nowrap="nowrap" >${list[1][0]}</td>
</tr>
</c:forEach>
这样试试