On 3/17/06, fea jabi <[EMAIL PROTECTED]> wrote:
> in strutsconfig.xml  the form bean attribute has
> <form-property name="newBalance" type="java.lang.String"/>
>
> Prepare jsp action
> Form1.set("newBalance", "100000");
>
> In jsp I have
> <fmt:formatNumber value="${Form1.map.newBalance}" type="currency"
> currencySymbol="" var="newBal"/>
> <html:text name="Form1" property="newBalance" value="${newBal}" />
>
> Validator.xml has
> <field property="newBalance" depends="double">
>                <msg name="double" key="notvalid"/>
> </field>
>
>
> The Dispatch action has
> DynaValidatorForm frm = (DynaValidatorForm)form;
>
>        ActionMessages messages = (ActionMessages)frm.validate( mapping,
> request );
>
>
> when I try to submit  the page/jsp getting Exception
> javax.servlet.ServletException: javax.servlet.jsp.JspException: In
> <formatNumber>, value attribute can not be parsed into
> java.lang.Number: "100,000.00"
>
> I understand that the String is entered i.e formbean has String value but
> validating if it's double value.
>
> How to handle such data? user entering in String but have to validate if
> it's double?

The problem seems to be that your using NumberFormat to try and format
a property thats a String (rather than a Number). Its not even getting
to do any sort of validation - just blowing up trying to display your
page.

If your form property is a String then you need to handle the
formatting before you populate the value to your form.

Niall

> Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to