struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinicius Caldeira Carvalho <vinicius.carva...@squadra.com.br>
Subject Re: Help with validator and xdoclet
Date Tue, 15 Mar 2005 18:28:26 GMT
Vinicius Caldeira Carvalho wrote:

> Hello there! I'm using for the first time, xdoclet to create my 
> validation.xml file (that really help)
> But I got stuck in a point. I have a property that must be float and 
> also greater than 0. Here's what I've tried:
>
>    /**
>     * @param limitePreAutorizacao The limitePreAutorizacao to set.
>     * @struts.validator type="float"
>     * msgkey="error.manterPlanoCobertura.valorLimite.incorreto"
>     *
>     * @struts.validator type="minLength"
>     * msgkey="error.menor"
>     *
>     * @struts.validator-args
>     * arg0resource="label.manterPlanoCobertura.limitePreAutorizacao"
>     *
>     * @struts.validator-args
>     * arg1value="${var:minlength}" name="minlength"
>     *
>     * @struts.validator-var
>     * name="minlength"
>     * value="0"
>     *
>     */
>
> This outputs :
>    <field property="limitePreAutorizacao"
>                     depends="float,minLength">
>                  <msg
>                    name="float"
>                    
> key="error.manterPlanoCobertura.valorLimite.incorreto"/>
>                  <msg
>                    name="minLength"
>                    key="error.menor"/>
>
>                  <arg0
>                    key="label.manterPlanoCobertura.limitePreAutorizacao"
>                  />
>                  <arg1
>                    key="${var:minlength}"
>                      resource="false"
>                  />
>                  <var>
>                    <var-name>minlength</var-name>
>                    <var-value>0</var-value>
>                  </var>
>              </field>
> First I got surprised that no name was given form arg1 ... well ok.
> So when I run the app leaving the field empty, an error is displayed
>
> ERROR [Validator] No ValidatorAction named minLength found for field 
> limitePreAutorizacao
>
> Could someone give me a hint on that?
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
Sorry all. But I was using the wrong name for the validator. But yet 
it's not working, this time however, it's nor validating or outputing 
errors on console.

any suggestions would be welcome

regards

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


Mime
View raw message