You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by VSGoud <sr...@yahoo.co.in> on 2009/12/02 13:50:32 UTC

problem with regex validator

Hi Friends, 
        I am using struts 2.1.6. Facing problem with error messages. 
 When i use 'regex' validator in validation.xml file than 
 1. when i clicked on submit button for the first time. 
       It is showing error messages like 
                 Customer name is required. 
                 Allow alphabets only. 
 the above message 'Allow alphabets only must show when some invalid data
enter in the field other than alphabets. 

2. with out entering data again i clicked submit button. 
than know error messages are 
  Customer name is required. 
  Allow alphabets only. 
  Customer name is required. 
  Allow alphabets only.       Repated twice. 

if i clicked again thrice......... 

And my code in xml file is, and using default theme 


<field name="customer.name">     
    <field-validator type="requiredstring" short-circuit="true"> 
      true
      <message key="error.cusname.req"></message> 
    </field-validator> 
    <field-validator type="regex" > 
            <![CDATA[(^[a-zA-Z ]+$)]]>
        <message key="error.cusname.fv"></message> 
    </field-validator> 
   </field> 

 if i remove regex than it is working fine. 

Could u tell me how to reolve this issue. 

Srikanth Goud 
-- 
View this message in context: http://old.nabble.com/problem-with-regex-validator-tp26608364p26608364.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: problem with regex validator

Posted by VSGoud <sr...@yahoo.co.in>.
Hi friends,
   any clue?

Srikanth

VSGoud wrote:
> 
> Hi Friends, 
>         I am using struts 2.1.6. Facing problem with error messages. 
>  When i use 'regex' validator in validation.xml file than 
>  1. when i clicked on submit button for the first time. 
>        It is showing error messages like 
>                  Customer name is required. 
>                  Allow alphabets only. 
>  the above message 'Allow alphabets only must show when some invalid data
> enter in the field other than alphabets. 
> 
> 2. with out entering data again i clicked submit button. 
> than know error messages are 
>   Customer name is required. 
>   Allow alphabets only. 
>   Customer name is required. 
>   Allow alphabets only.       Repated twice. 
> 
> if i clicked again thrice......... 
> 
> And my code in xml file is, and using default theme 
> 
> 
> <field name="customer.name">     
>     <field-validator type="requiredstring" short-circuit="true"> 
>       true
>       <message key="error.cusname.req"></message> 
>     </field-validator> 
>     <field-validator type="regex" > 
>             <![CDATA[(^[a-zA-Z ]+$)]]>
>         <message key="error.cusname.fv"></message> 
>     </field-validator> 
>    </field> 
> 
>  if i remove regex than it is working fine. 
> 
> Could u tell me how to reolve this issue. 
> 
> Srikanth Goud 
> 

-- 
View this message in context: http://old.nabble.com/problem-with-regex-validator-tp26608364p26626095.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org