• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Issue in validating + symbol

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

I am having trouble in validating "+" symbol using struts validatin framework

this is my entry in validation.xml

<form name="accountQueryForm">
<field
property="accountNumber"
depends="mask">
<arg key="prompt.accountnumber"/>
<arg1 key="errors.alphanumeric"/>
<var>
<var-name>mask</var-name>
<var-value>^[0-9a-zA-Z&@_()$*-/,.]*$</var-value>
</var>
</field>
<form>

But the framewotrk is not able to validate + character . ie Even if user enters + character the error message is not shown . It works fine for other characters like #,% etc but + seems to create a problem . In regular expressions i know it is a metacharacter and has special meaning but not able to figure out the problem

Can some one give some pointers how i can solve this problem
 
brevity is the soul of wit - shakepeare. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic