I'm getting 'java.lang.IllegalArgumentException: Cannot format given Object
as a Number' when I use the message format below. I tried simplifying to
just {1} characters instead of {1,number,integer} but no luck

-----Original Message-----
From: Karr, David [mailto:david.karr@;attws.com]
Sent: Monday, October 21, 2002 13:01
To: 'Struts Users Mailing List'
Subject: RE: ChoiceFormat for message formatting?


> -----Original Message-----
> From: Andy Kriger [mailto:akriger@;greaterthanone.com]
> Sent: Monday, October 21, 2002 9:21 AM
>
> Can ChoiceFormat be used to format messages in the app
> properties file?
>
> For example, the validator error.maxlength is
> {0} can not be greater than {1} characters.
>
> This will produce '<field> can not be greater than 1 characters'
>
> I am trying to use the ChoiceFormat to work so this can be
> grammatically
> correct, but this is not working...
> {0} can not be more than {1,choice,1#one
> character|1<{1,number,integer}
> characters}.
>
> Should it work? Do I have a format string problem?

You should be able to do this, yes.  Are you certain your message is on a
single line in the properties file, or uses continuation characters for
multiple lines?

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>

Reply via email to