Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validate uploaded Files with the Validator-Framework

 
Florian Kammermann
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following trouble:

I use only DynaValidatorForms for passing the Formdatas.
The validation of the input I make with pluggable validator-classes, which I configure in the validator-rules.xml.
For String-validation this is no problem, but how I can get a FormFile-Object from the DynaValidatorForm?

Such a pluggable class have the following look:

public static boolean validateActualPassword(
Object bean,
ValidatorAction va,
Field field,
ActionErrors errors,
HttpServletRequest request) {

//Get the propertys
String actualPWD = ValidatorUtil.getValueAsString( bean, field.getProperty());
String sProperty2 = field.getVarValue("secondProperty");
String username = ValidatorUtil.getValueAsString( bean, sProperty2);


I found nothing on the web, how I can get a property as a Fromfile and not as a String.

Thanks for reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic