I had the same problem with file uploads using Struts 2.0.6
I tracked down the source of this problem. To summarize, it's a bug
that's specific to the Struts 2.0.6 tag; it has since been fixed in
the repository. The class in question is the FilterDispatcher. In
short when uploading a file, the request object needs to be wrapped
by the MultiPartRequestWrapper, but it doesn't always happen, because
of a flaw in the logic.
Experimenting with the context cleanup filter has proven successful,
although I haven't tested thoroughly with that solution. The solution
I've chosen to use is fixing the FilterDispatcher bug in my source.
I have more details in a blog post here: http://blog.lo-fi.net/
2007/04/i-know-why-struts-2-file-upload-fails.html
I hope this helps put this issue to rest,
Eric Rank
On Apr 16, 2007, at 6:45 AM, Dave Newton wrote:
--- Mahdi Milani Fard <[EMAIL PROTECTED]> wrote:
I'm trying to upload a file with struts2 [...]
Try including the action context cleanup filter as the
first filter in your web.xml. If that fixes it for you
as well I'll add something to the upload wiki docs, so
please follow up.
<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ActionContextCleanUp
</filter-class>
</filter>
d.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]