tags:

views:

23

answers:

0

My issue is that i have an annotation in Struts2 action class like

private String[] origfilenofrom;

@FieldExpressionValidator(fieldName="origfilenofrom",key="",message="File Length should be 12 for old file format and 15 for new file format",expression="checkorigFileFormat(origfilenofrom)")

now my mehtod is

public boolean checkorigFileFormat(String[] files )
 {   
  for(int counter=0;counter<files.length;counter++)
     {
   int n=files[counter].length();
   if(!(n==12 || n==15))
   {
    return false;
   }
     }
     return true;
 }

So for any string in that string [], which is returning false the value is bei false. No matter 3 strings in that string [] are true if one is false then the annotaion message is displayed for all.

I want the message not to display where the string is true. Help please