我有看起来像这样的文件对象
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>