我有File對象,它看起來像這樣如何設置Struts 2的對象一個Struts 2標籤內(A HREF)
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>
標記中顯示fileName和filePath。
目標是讓href指向filePath。我嘗試過使用OGNL,例如#,%{},$(),而且似乎都沒有正確顯示鏈接。
如:
<s:a href="?????????"> Click to the get the File </s:a>
你能提供你的動作類代碼嗎? –