I could be wrong but I believe you'd have to implement your own file upload
interceptor and make sure the file is not removed after the execution of the
action if a validation error occurs.  Then you'd need to re-associate that
saved file when the next request occurs.  Also what happens if they never
resubmit the request.  You will have a file sitting around.

I can't think of a good way to handle that scenario since your not storing
any information in the session or persistence layer and each request is
really stateless.

Adding client side validation might be your best bet.  That way the file
isn't even submitted until the form passes validation.


Khawaja-Shahzad Butt wrote:
> 
> Hi,
> 
> I am having an issue with struts file upload during validation. On the
> page
> when there's
> a  validation error, the browsed/attached file drops. Does anyone
> know a work around it, to have the previously attached file in tact,
> meaning
> if i have attached a file and hit submit and got the validation error, the
> file should still be
> there, so that i don't have reattach it again.
> 
> Storing the file in session is out of league as it's not a good approach.
> 
> Again my problem is if i attach a file and hit submit button and get
> validation errors defined
> in validation.xml, i fix the validation error and now i have re-attach
> that
> file again since it
> gets detached.
> 
> Please reply.
> 
> Thanks
> Thanks
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Managing-file-attachment-tp20762606p20766975.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to