|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
how to use webwork filedowni want to use webwork down file,but i don't know how to write code in web page.
xwork.xml: <action name="downlicense" class="com.lingyitech.ap.action.DownLicenseAction"> <param name="inputPath">/ip.txt</param> <result name="success" type="dispatcher"> <param name="location">/license.html</param> </result> <result name="input"> <param name="location">/license.html</param> </result> <result name="download" type="stream"> <param name="contentType"> application/x-msdownload </param> <param name="inputName">docStream</param> <param name="bufferSize">1024</param> <param name="contentDisposition"> ${contentDisposition} </param> </result> <interceptor-ref name="params" /> </action> DownLicenseAction: public FileInputStream docStream; public String contentDisposition; public File input; public String downLoadFile() { try { input = new File("f:/ip.txt");System.out.println("input"); docStream = new FileInputStream(input); contentDisposition = "filename=\"ip.txt\""; } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } return "download"; } --------------------------------------------------------------------- Posted via Jive Forums http://forums.opensymphony.com/thread.jspa?threadID=603083&messageID=698774#698774 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
| Free embeddable forum powered by Nabble | Forum Help |