struts2在windows下可以下载 在linux下报错

以下配置在windows下可以下载 在linux下无法下载....



struts.xml





        <action name="down" class="downloadAction">

        ${inputPath}

            <result name="successDown" type="stream">

                inputStream

                attachment;filename=${filename}

            </result>

            <result name="fileError">error.jsp</result>

</action>



action:

public java.io.InputStream getInputStream() {

InputStream stream = null;

try {

stream = new java.io.FileInputStream(this.getInputPath());

} catch (FileNotFoundException e) {

e.printStackTrace();

}

return stream;

}



public String execute() throws Exception {




this.setInputPath(cmsOfflineResources.getResourcePath());




setFilename(downloadname + filetype);






return "successDown";

}



//get set 方法省略





报错 无法找到 inputStream:

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:518)

org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)

org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)





where is your "this.getInputPath()"?

路径有问题吧?

LS所言极是,应该把getInputPath()贴出来。