Struts2多文件上传只需要将 单文件上传中的File变成File[] 即可,上篇文章:
action:
public class UploadAction { private File[] image; private String[] imageFileName; private String[] imageContentType; private String message; public String uploadImage() { try { String realPath = ServletActionContext.getServletContext().getRealPath("/images"); File filePath = new File(realPath); if (!filePath.exists()) { filePath.mkdirs(); } System.out.println("文件存放路径:" + realPath); for(int i=0;i