You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by kaouki <in...@gmail.com> on 2007/10/23 14:59:29 UTC

[S2] Problem with Double validation

Hello,

I am trying to submit my form but I have a validator problem on a texfield:
<s:textfield id="prixHT" label="Prix HT" name="dvd.prixHT"
cssClass="field"/>

prixHT is a Double that I set to 19.99, and I validate data with annotations
:
@Validations(
            requiredStrings = {
                    ...,
                    @RequiredStringValidator(
                            message = "Champ obligatoire", fieldName =
"dvd.prixHT", type = ValidatorType.SIMPLE)
            },
            conversionErrorFields = {
                    @ConversionErrorFieldValidator(
                            message = "Le prix doit être au format
numérique", fieldName = "dvd.prixHT")
            }
    )
public String save() {
...
}

I have the following messages on the input page:
Invalid field value for field "dvd.prixHT".
Le prix doit être au format numérique
Champ obligatoire

And I found this trace in my logs:
Entering nullPropertyValue
[target=com.teamlog.sample.domain.produit.dvd.Dvd@a00770, property=prixHT]

Thank you for yours answers,
K.
-- 
View this message in context: http://www.nabble.com/-S2--Problem-with-Double-validation-tf4677298.html#a13363800
Sent from the Struts - User mailing list archive at Nabble.com.


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