Struts Validation : mask not working
Hi Friends
I am developing an application using Struts & Validator Framework
i m checking if the user has not entered any value in strSiteName field, and also that the name should contain only alphabets.
i have included validation.xml & validator-rules.xml in WEB-INF folder
i have also enabled validator plug in code in struts-config.xml
here's the code :
In validation.xml :
<form name="SiteRequestForm">
<field property="strSiteName" depends="required,mask">
<arg0 key="prompt.sitename"/>
<var>
<var-name>mask</var-name>
<var-value>^[a-zA-Z]*$</var-value>
</var>
</field>
In struts config:
<action path="/siterequest" type="com.geis.siip.action.SiteRequestAction" name="SiteRequestForm" input="/jsp/siteRequest.jsp" scope="request" validate="true">
<forward name="success" path="/jsp/siteRequest.jsp"/>
<forward name="home" path="/home.do"/>
<forward name="failure" path="/jsp/errorpage.jsp"/>
<forward name="sessionOut" path="/jsp/Logout.jsp"/>
</action>
The required validation is working , but the mask is not working.
Kindly help me to fix this problem.
Thanks in advance.