Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Struts Validation : mask not working

843838Mar 8 2006
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2006
Added on Mar 8 2006
0 comments
152 views