Issue Details (XML | Word | Printable)

Key: WW-634
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Patrick Lightbody
Reporter: Martin Crawford
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
WebWork

File Upload Interceptor stack

Created: 09/Sep/04 03:46 PM   Updated: 10/Sep/04 12:06 PM
Component/s: Interceptors
Affects Version/s: 2.1.1
Fix Version/s: 2.1.2


 Description  « Hide
Ripped from my blog...

Discouragingly, the documentation around hasn't been updated to explain the new FileUploadInterceptor (which conceptually rawks BTW) to detail the proper way to configure the xwork.xml file. I found that you need both the "defaultStack" interceptor stack proceeded by the new "fileUpload" interceptor. Ideally I would think the webwork-defaults.xml file should define something like:

<interceptor-stack name="fileUploadStack">
   <interceptor-ref name="fileUpload">
   <interceptor-ref name="defaultStack">
</interceptor-stack>>

then all you would need is to include the reference to the fileUploadStack with the appropiate action definition. Of course, I'm sure there are reasons not to include this in the defaults.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Martin Crawford added a comment - 09/Sep/04 07:26 PM
After sober thought, I think it would actually make sense to add the File Upload Interceptor to the default stack and just optimise the interceptor to handle both regular content and multipart content. That way framework users only need expose the appropiate File parameters and not worry about the extra configuration.

Patrick Lightbody added a comment - 10/Sep/04 12:06 PM
I've updated a bunch of sample stacks. The fileUpload stack is already configued to work even when the request isn't multipart, so now you can just use the "completeStack" which has most of the features in place.