一、xml配置:
<!-- 下载注册程序 -->
<action name="downRegversKey" class="acAccounts" method="downloadFile">
<!-- 下载现有文件 -->
<param name="inputPath">/files_ocx</param>
<!-- 初始文件名 -->
<param name="fileName">${downFileName}</param>
<!-- result的Type必须为stream -->
<result name="success" type="stream">
<!-- 下载文件类型 -->
<param name="contentType">
application/octet-stream;charset=ISO8859-1
</param>
<!-- 下载对话框所弹出的文件名 -->
<param name="contentDisposition">
fileName="zcglkey.exe"
</param>
<!-- 下载的InputStream流,Struts2自己动对应Action中的getDownloadFile方法,该方法必须返回InputStream类型 -->
<param name="inputName">downloadFile</param>
</result>
</action>