Greetings!
I have a problem with downloading file, using DownloadFileAction, same as in
Showcase.
There was a problem, like mine, and it was solved, but this doesn't help
me...


In my application I need to upload the MSAccess db on the server, and, after
processing, download it back.
Uploading and processing works fine, but I'm really stuck with download.

Here is my struts-fileupload.xml:

<action name="download" class="actions.updown.FileDownloadAction">
            <result name="success" type="stream">
                inputStream
                application/msaccess
                4096
            </result>
</action>

______________________________________________________________________________

Here is the action:

public class FileDownloadAction implements Action {

        private String inputPath;
    
        
    public void setInputPath(String value) {
        inputPath = value;
    }
    
    public InputStream getInputStream() throws Exception {
        return
ServletActionContext.getServletContext().getResourceAsStream(inputPath);
    }

    public String execute() throws Exception {
        return SUCCESS;
    }

}

______________________________________________________________________________

Here is the element of my JSP:

<s:url id="downloadUrl" action="download" namespace="/updown">
            <s:param name="inputPath" value="%{uploadPath}" />
    </s:url>
<s:a href="%{downloadUrl}">download file</s:a>
______________________________________________________________________________

AND!!! Here is THE PROBLEM:

javax.servlet.ServletException: java.lang.IllegalArgumentException: Can not
find a java.io.InputStream with the name [inputStream] in the invocation
stack. Check the  tag specified for this action.
        
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)

org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
-- 
View this message in context: 
http://www.nabble.com/download-file-problem-tf4711389.html#a13466635
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to