Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C268A1122D for ; Tue, 16 Sep 2014 06:53:35 +0000 (UTC) Received: (qmail 34523 invoked by uid 500); 16 Sep 2014 06:53:35 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 34490 invoked by uid 500); 16 Sep 2014 06:53:35 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 34479 invoked by uid 99); 16 Sep 2014 06:53:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2014 06:53:35 +0000 Date: Tue, 16 Sep 2014 06:53:35 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (WW-4388) Parameters are not injected when upload file MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-4388: ------------------------------ Fix Version/s: (was: 2.3.18) 2.3.x > Parameters are not injected when upload file > --------------------------------------------- > > Key: WW-4388 > URL: https://issues.apache.org/jira/browse/WW-4388 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors > Affects Versions: 2.3.18 > Reporter: zhouyanming > Priority: Blocker > Fix For: 2.3.x > > > {code:java} > import java.io.File; > import org.apache.struts2.ServletActionContext; > import com.opensymphony.xwork2.ActionSupport; > public class UploadAction extends ActionSupport { > private static final long serialVersionUID = 625509291613761721L; > private File[] file; > private String[] fileFileName; > private String folder; > private boolean autorename; > public boolean isAutorename() { > return autorename; > } > public void setAutorename(boolean autorename) { > this.autorename = autorename; > } > public void setFolder(String folder) { > this.folder = folder; > } > public String getFolder() { > return folder; > } > public void setFile(File[] file) { > this.file = file; > } > public void setFileFileName(String[] fileFileName) { > this.fileFileName = fileFileName; > } > @Override > public String execute() { > System.out.println(file); // not null > System.out.println(fileFileName); // not null > System.out.println(folder); // always null > System.out.println(autorename); // always false > // workaround for struts2 bug > folder = ServletActionContext.getRequest().getParameter("folder"); > autorename = "true".equals(ServletActionContext.getRequest() > .getParameter("autorename")); > System.out.println(folder); // not null > System.out.println(autorename); // true > return SUCCESS; > } > } > {code} > It works fine with 2.3.16. -- This message was sent by Atlassian JIRA (v6.3.4#6332)