wood burning stoves*
The moose likes Struts and the fly likes Struts2 Regex Validation killing me, Please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 Regex Validation killing me, Please help" Watch "Struts2 Regex Validation killing me, Please help" New topic
Author

Struts2 Regex Validation killing me, Please help

Prav Chau
Ranch Hand

Joined: Jul 17, 2007
Posts: 58
Hi Friends,

I am trying to use regex for normal string validation. Tried various regular expression but struts2 validation didn't work for me. In below example I am trying to validate string which will have only Capital letters A to Z. Can anyone help me to find correct regular expression for validating string with special characters.

<field name="regexValidatorField">
<field-validator type="regex">
<param name="expression"><![CDATA[[A-Z]]]></param>
<message><![CDATA[ regexValidatorField must have all capilate A- Z characters ]]></message>
</field-validator>
</field>


Prav Chau
SCJP, SCWCD, SCBCD, SCEA, http://pravinchaudhari.blogspot.com/
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That regex is only for a single character.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 Regex Validation killing me, Please help