Some more details: I've tracked this down to the request somehow not
being a MultiPartRequestWrapper. The problem shows up in the
FileUploadInterceptor class, specifically in the following code:
public String intercept(ActionInvocation invocation) throws
Exception {
ActionContext ac = invocation.getInvocationContext();
HttpServletRequest request = (HttpServletRequest)
ac.get(ServletActionContext.HTTP_REQUEST);
if (!(request instanceof MultiPartRequestWrapper)) {
// STRUTS IS GOING HERE WITH MY REQUEST.
// IT SAYS THE REQUEST IS A RequestFacade OBJECT.
// WHY???
}
}
When I look at the request in the debugger, it appears to be something
called a RequestFacade. It's not a MultiPartRequestWrapper, so the
intercept() routine exits without initializing my Action.
The HTML form that posted the data looks like this:
<form id="uploadKeyframe" name="uploadKeyframe" onsubmit="return true;"
action="uploadKeyframe.action" method="POST"
enctype="multipart/form-data">
I've specified "multipart/form-data", but that info seems to be lost
when it arrives at the FileUploadInterceptor.
Any ideas? This has me stumped. I'm thinking about writing my own file
interceptor to use until I can figure out what is going on with the
Struts version.
Thanks in advance for any suggestions,
kell
> > >
> > > From: Kelly Morrison [mailto:[EMAIL PROTECTED]
> > > Sent: Wed 3/28/2007 12:30 AM
> > > To: Struts Users Mailing List
> > > Subject: File upload fails first time, then works after page
reload
> > >
> > > I'm a Struts newbie having problems with the file upload in
Struts
> > > 2.0.6 with Tomcat 6.0.10. When I select a file and submit it, the
> > > setXXX(), setXXXContentType(), and setXXXFileName() methods in my
> > > action aren't being called. However, if I then hit the Back button
> > > and try again, it works and my setters are called.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]