手工处理 Struts2 框架上传的文件

在使用了 Struts2 框架的系统中,对于处理像下面这种表单上传文件时:

自然而然的想法就是在 Action 中声明变量 File upload 和 String desc,请求提交到这个 Action 后,在 execute() 方法中就能直接使用 upload 和 desc 了,它们已被 Struts2 框架(org.apache.struts2.interceptor.FileUploadInterceptor 监听器) 赋上了相应的值了。 阅读全文 >>