Return-Path: X-Original-To: apmail-struts-dev-archive@www.apache.org Delivered-To: apmail-struts-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EAA1418CD8 for ; Wed, 24 Feb 2016 15:27:38 +0000 (UTC) Received: (qmail 38303 invoked by uid 500); 24 Feb 2016 15:27:26 -0000 Delivered-To: apmail-struts-dev-archive@struts.apache.org Received: (qmail 38224 invoked by uid 500); 24 Feb 2016 15:27:26 -0000 Mailing-List: contact dev-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list dev@struts.apache.org Received: (qmail 38212 invoked by uid 99); 24 Feb 2016 15:27:25 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2016 15:27:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 4BDD91804EF for ; Wed, 24 Feb 2016 15:27:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.651 X-Spam-Level: ** X-Spam-Status: No, score=2.651 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.329] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id iiBu7ydmZslY for ; Wed, 24 Feb 2016 15:27:23 +0000 (UTC) Received: from iron2.lex-com.net (smtp5.lex-com.net [193.159.191.10]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 5F8485FAF1 for ; Wed, 24 Feb 2016 15:27:22 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.22,494,1449529200"; d="scan'208";a="48832007" Received: from unknown (HELO mucle03.lex-com.net) ([10.89.20.108]) by iron2.lex-com.net with ESMTP; 24 Feb 2016 16:27:16 +0100 In-Reply-To: References: To: "Struts Developers List" MIME-Version: 1.0 Subject: Re: MultiPartRequestWrapper X-KeepSent: FCE7154C:D74EE5C1-C1257F63:0053C1DD; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.3 September 15, 2011 Message-ID: From: Christoph Nenning Date: Wed, 24 Feb 2016 16:27:11 +0100 X-MIMETrack: Serialize by Router on MUCLE03/Lexcom_Muenchen/LEXCOM(Release 9.0.1FP4|June 07, 2015) at 24.02.2016 16:27:33, Serialize complete at 24.02.2016 16:27:33 Content-Type: multipart/alternative; boundary="=_alternative 0054E16FC1257F63_=" --=_alternative 0054E16FC1257F63_= Content-Type: text/plain; charset="US-ASCII" > Hi, > we are trying to migrate a big webapp (a thousand pages) from struts1 to > struts2. > One of the first step was to introduce the StrutsPreparefilter, leaving > everything served by the ActionServlet. > Then we removed the objects request and response from every action's > methods signature, leaving them managed only in action ancestor class. Sounds like an intersting migration strategy. Can you tell us more about it? > Talking about multipart request, we extended JakartaMultiPartRequest to > override the parse method in order to leave request parsed by our code. > Now we would like to leave request parse made by JakartaMultiPartRequest, > removing the override, but we need access to the fileitems uploaded by > users. In other words, our action ancestor class needs to get access to > the "files" properties of JakartaMultiPartRequest through the > MultiPartRequestWrapper. Otherwise we need to code something similar to > what is done by the FileUploadInterceptor.intercept and create againg the > fileitem needed by our application code. I would prefer to just use FileUploadInterceptor. > > The request is: can you change the MultiPartRequestWrapper, and the > JakartaMultiPartRequest, adding a public getFileItems(String) method? Please create jira for that. And specify if you would like to see it in struts 2.3 series or if you are happy with struts 2.5. That method would be trivial to implement for JakartaMultiPartRequest, but there are other implementations of MultiPartRequest which don't have easy access to FileItems. So I'm not sure if this will be added. > > Another question: in Dispatcher.wrapRequest there is no update of request > in context, so a ServletActionContext.getRequest() never return the > MultiPartRequestWrapper (or StrutsRequestWrapper). Why? > When you look at FileUploadInterceptor.intercept you see that MultiPartRequestWrapper is obtained from ActionContext. But I don't know where it is set. If you think it is a bug you can create another jira. Regards, Christoph This Email was scanned by Sophos Anti Virus --=_alternative 0054E16FC1257F63_=--