File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynaforms, Validator and File Upload

 
Ryan Tyer
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 374
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ryan Tyer
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 374
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 415
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic