Use the *preferred* method, the interceptor. I haven't looked in to what caused the breaking change.
Dave --- On Tue, 12/16/08, red phoenix <rodphoe...@gmail.com> wrote: > From: red phoenix <rodphoe...@gmail.com> > Subject: Re: org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be > cast to org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper > To: "Struts Users Mailing List" <user@struts.apache.org>, > newton.d...@yahoo.com > Date: Tuesday, December 16, 2008, 10:26 AM > In > http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html > , it use > MultiPartRequestWrapper multipartRequest = > (MultiPartRequestWrapper) > ServletActionContext.getRequest(); > It still raise java.lang.ClassCastException: > org.apache.struts2.dispatcher.StrutsRequestWrapper cannot > be cast to > org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper. > My popuse is that when jsp sumbit to action,I can get > upload file name and > the stream of upload file,then I can write the stream of > upload file into > blob of oracle database.I don't know how to get the > stream of upload file! > I still puzzled with why raise above error. I don't > find the different > between my code and > http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html. > > Where wrong with my code? > > > > > On Tue, Dec 16, 2008 at 11:13 PM, Dave Newton > <newton.d...@yahoo.com> wrote: > > > --- On Tue, 12/16/08, red phoenix wrote: > > > [...] > > > MultiPartRequestWrapper multipartRequest = > > > (MultiPartRequestWrapper) > ServletActionContext.getRequest(); > > > [...] > > > > > > > org.apache.struts2.dispatcher.StrutsRequestWrapper cannot be > cast to > > > > org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper > > > > > > Why raise above error? > > > > Because StrutsRequestWrappers can't be cast to > MultiPartRequestWrappers. > > > > > How to correct it? > > > > Use the built-in file upload capabilities of Struts 2; > there's no reason to > > access the request manually. > > > > Here's that link again: > > > > > http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html > > > > Dave > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > user-unsubscr...@struts.apache.org > > For additional commands, e-mail: > user-h...@struts.apache.org > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org