FileDocCategorySizeDatePackage
FileDownloadAction.javaAPI DocApache Struts 2.0.9 Apps1661Mon Jul 23 13:43:26 BST 2007org.apache.struts2.showcase.filedownload

FileDownloadAction

public class FileDownloadAction extends Object implements com.opensymphony.xwork2.Action
Demonstrates file resource download. Set filePath to the local file resource to download, relative to the application root ("/images/struts.gif").

Fields Summary
private String
inputPath
Constructors Summary
Methods Summary
public java.lang.Stringexecute()

        return SUCCESS;
    
public java.io.InputStreamgetInputStream()

        return ServletActionContext.getServletContext().getResourceAsStream(inputPath);
    
public voidsetInputPath(java.lang.String value)

        inputPath = value;