aspose file tools*
The moose likes Struts and the fly likes Dynaforms, Validator and File Upload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynaforms, Validator and File Upload" Watch "Dynaforms, Validator and File Upload" New topic
Author

Dynaforms, Validator and File Upload

Ryan Tyer
Greenhorn

Joined: Sep 01, 2004
Posts: 6
Is it possible to setup dynaforms with validation for a simple file upload in Struts? If so, how?

Thanks in advance.
David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
Yes and no. The main key is to use DynaValidatorForm rather than a simple DynaForm. DynaForm will not invoke the Validator framework while DynaValidatorForm will. You may then configure validation as with any other form.


"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
Ryan Tyer
Greenhorn

Joined: Sep 01, 2004
Posts: 6
Yeah, I understand the usage of DynaValidatorForm, but what do I have as my field? Typically on file upload you use a FormFile object. I'm not sure I know how to do validation on that (ie, file extension = .csv).
David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
Guess I misunderstood the question.
Anyway, I don't know... I haven't used the upload piece specifically.

You could write a validator class Facade for the FormFile validation, though.
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi ryan

U cant validate the for formfile object (uplodaed file) using strust validation techniques.U should go for actionform and then u can do the valkidation by using ur java techniques

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynaforms, Validator and File Upload