GeeCON Prague 2014*
The moose likes Struts and the fly likes problem in using mask validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in using mask validation" Watch "problem in using mask validation" New topic
Author

problem in using mask validation

Pushkar Choudhary
Rancher

Joined: May 21, 2006
Posts: 425

hi all,

i'm trying to use mask validator in my application, but its not working.

alongwith mask, i'm using minlength and required validators and they're working fine. but, when these two conditions are satisfied, the application shows me errors related to mask validator (even if the condition for mask validator is satisfied)

I have this entry in my validation.xml:




This is the entry in validator-rules.xml:




and this is the entry in my ApplicationResources.properties file



"minlength" and "required" are working fine.... the problem is with mask validator...

any help would be greatly appreciated.


thanks,
Pushkar.
Pushkar Choudhary
Rancher

Joined: May 21, 2006
Posts: 425

hi all,

i was able to get through the application successfully, but only when i removed the global constant "validationMask" (which i had declared in my validation.xml file) and replaced it with a regex for validation.

can anyone please take a look at the global constant declared in the code (validation.xml code provided in my previous post) and tell me what is wrong in the declaration..??

Thanks,
Pushkar.
Pushkar Choudhary
Rancher

Joined: May 21, 2006
Posts: 425

doesn't Merril or anyone else have any answer for this..???
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The definition of the global constant is fine. It's the reference to the global constant that's wrong. It should be:

${validationMask} -- with curly braces

rather than

$(validationMask) -- with parenthesis


Merrill
Consultant, Sima Solutions
Pushkar Choudhary
Rancher

Joined: May 21, 2006
Posts: 425

oops.... silly mistake...!!!


anyways... it works fine now...

thanks a lot Merril...


Regards,
Pushkar.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem in using mask validation