Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 657D5200C78 for ; Thu, 13 Apr 2017 07:33:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 64196160BA9; Thu, 13 Apr 2017 05:33:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8DCB5160B95 for ; Thu, 13 Apr 2017 07:33:46 +0200 (CEST) Received: (qmail 14842 invoked by uid 500); 13 Apr 2017 05:33:45 -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 14827 invoked by uid 99); 13 Apr 2017 05:33:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Apr 2017 05:33:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 0EC60C2213 for ; Thu, 13 Apr 2017 05:33:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.001 X-Spam-Level: X-Spam-Status: No, score=-100.001 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id kpHRAoeAPjpM for ; Thu, 13 Apr 2017 05:33:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 9FAC95FAE1 for ; Thu, 13 Apr 2017 05:33:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1AADCE00C4 for ; Thu, 13 Apr 2017 05:33:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id C607F24066 for ; Thu, 13 Apr 2017 05:33:41 +0000 (UTC) Date: Thu, 13 Apr 2017 05:33:41 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (WW-4782) Struts2.5.10.1 upload photo file can't set success MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 13 Apr 2017 05:33:47 -0000 [ https://issues.apache.org/jira/browse/WW-4782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-4782: ------------------------------ Description: Hi ,today i found my application can't upload file success,Could you help me check it? I have do it follow the guide: http://struts.apache.org/docs/file-upload.html the error message as below : {noformat} Unexpected Exception caught setting 'upload' on 'class com.opensymphony.xwork2.ActionSupport: Error setting expression 'upload' with value ['org.apache.struts2.dispatcher.multipart.StrutsUploadedFile@22261709', ] ERROR ParametersInterceptor Developer Notification (set struts.devMode to false to disable this message): Unexpected Exception caught setting 'uploadContentType' on 'class com.opensymphony.xwork2.ActionSupport: Error setting expression 'uploadContentType' with value ['image/jpeg', ] ERROR ParametersInterceptor Developer Notification (set struts.devMode to false to disable this message): Unexpected Exception caught setting 'uploadFileName' on 'class com.opensymphony.xwork2.ActionSupport: Error setting expression 'uploadFileName' with value ['tabletennis_head.jpg', ] {noformat} index.jsp {code:xml}
{code} Action file: {code:java} private File upload; private String uploadContentType; private String uploadFilename; public File getUpload() { return upload; } public void setUpload(File upload) { this.upload = upload; } public String getUploadContentType() { return uploadContentType; } public void setUploadContentType(String uploadContentType) { this.uploadContentType = uploadContentType; } public String getUploadFilename() { return uploadFilename; } public void setUploadFilename(String uploadFilename) { this.uploadFilename = uploadFilename; } public String execute() { System.out.println("--------haaaaaaaaaa-----start---------------"); System.out.println(upload); System.out.println(uploadContentType); System.out.println(uploadFilename); System.out.println("--------haaaaaaaaaa------end--------------"); return SUCCESS; } {code} was: Hi ,today i found my application can't upload file success,Could you help me check it? I have do it follow the guide: http://struts.apache.org/docs/file-upload.html the error message as below : Unexpected Exception caught setting 'upload' on 'class com.opensymphony.xwork2.ActionSupport: Error setting expression 'upload' with value ['org.apache.struts2.dispatcher.multipart.StrutsUploadedFile@22261709', ] ERROR ParametersInterceptor Developer Notification (set struts.devMode to false to disable this message): Unexpected Exception caught setting 'uploadContentType' on 'class com.opensymphony.xwork2.ActionSupport: Error setting expression 'uploadContentType' with value ['image/jpeg', ] ERROR ParametersInterceptor Developer Notification (set struts.devMode to false to disable this message): Unexpected Exception caught setting 'uploadFileName' on 'class com.opensymphony.xwork2.ActionSupport: Error setting expression 'uploadFileName' with value ['tabletennis_head.jpg', ] > Struts2.5.10.1 upload photo file can't set success > -------------------------------------------------- > > Key: WW-4782 > URL: https://issues.apache.org/jira/browse/WW-4782 > Project: Struts 2 > Issue Type: Bug > Components: Core > Affects Versions: 2.5.10 > Environment: Windows10 ,jdk1.7.80, struts2.5.10.1 > Reporter: fairy > Labels: struts2.5.10.1, upload > > Hi ,today i found my application can't upload file success,Could you help me check it? > I have do it follow the guide: > http://struts.apache.org/docs/file-upload.html > the error message as below : > {noformat} > Unexpected Exception caught setting 'upload' on 'class com.opensymphony.xwork2.ActionSupport: Error setting expression 'upload' with value ['org.apache.struts2.dispatcher.multipart.StrutsUploadedFile@22261709', ] > ERROR ParametersInterceptor Developer Notification (set struts.devMode to false to disable this message): > Unexpected Exception caught setting 'uploadContentType' on 'class com.opensymphony.xwork2.ActionSupport: Error setting expression 'uploadContentType' with value ['image/jpeg', ] > ERROR ParametersInterceptor Developer Notification (set struts.devMode to false to disable this message): > Unexpected Exception caught setting 'uploadFileName' on 'class com.opensymphony.xwork2.ActionSupport: Error setting expression 'uploadFileName' with value ['tabletennis_head.jpg', ] > {noformat} > index.jsp > {code:xml} >
>
> > > method="POST" enctype="multipart/form-data"> > > > >
>
> {code} > Action file: > {code:java} > private File upload; > private String uploadContentType; > private String uploadFilename; > public File getUpload() { > return upload; > } > public void setUpload(File upload) { > this.upload = upload; > } > public String getUploadContentType() { > return uploadContentType; > } > public void setUploadContentType(String uploadContentType) { > this.uploadContentType = uploadContentType; > } > public String getUploadFilename() { > return uploadFilename; > } > public void setUploadFilename(String uploadFilename) { > this.uploadFilename = uploadFilename; > } > public String execute() { > System.out.println("--------haaaaaaaaaa-----start---------------"); > System.out.println(upload); > System.out.println(uploadContentType); > System.out.println(uploadFilename); > System.out.println("--------haaaaaaaaaa------end--------------"); > return SUCCESS; > } > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)