【发布时间】:2013-12-31 18:27:06
【问题描述】:
我有一个看起来像这样的文件对象
public class FileTO implements Serializable{
private String fileName;
private String filePath;
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
当然,我的 struts 动作响应中还有很多其他对象,我没有在这里列出。
操作完成后,filePath 将填充它所在文件的实际路径,以便可以下载文件。我想在<s:a> 标记中显示文件名和文件路径。
目标是让 href 指向 filePath。我尝试使用 OGNL,即 #、%{}、$(),但似乎都没有正确显示链接。
例如:
<s:a href="?????????"> Click to the get the File </s:a>
【问题讨论】:
-
你能提供你的动作类代码吗??
标签: java jsp struts2 ognl struts-tags