It turns out that the problem I was having - had nothing to do with
type conversion.

The problem was a chunk of my code that was responsible for formatting.
Specifically, the exception "IllegalArgumentException: Cannot format
given Object as a Number" was thrown because of

<s:text name="format.money" >
    <s:param name="value" value="myd"/>
</s:text>

(format.money is defined in  package properties -->format.money =
{0,number,ยค##0.00})

"myd" supposed to be a double. The problem occurred when wrong value
was inserted instead of double (e.g. 'aaa' instead of 7,5).
The same code threw no exceprion in struts 2.0, but in 2.1.6 it does.
(I said earlier that earlier that showcase run differently than blank
... but I thing that was due to the fact that I didn't copy all the
code from one project to other - sorry about that ;)

So the problem is not so serious as I thought it was.  I will try to
solve this by checking first if
myd contains double or not before formatting....


On Fri, Jan 23, 2009 at 8:37 PM, Sergio Italiani <sergiode...@gmail.com> wrote:
> Hi All!
> Could anybody please tell me if I should add anything to the
> struts2blank  project (of struts 2.1.6)  so that type conversion error
> handling
> ( i mean the --> invalid.fieldvalue.fieldname) would work properly.
> I am clearly missing something, because instead of displaying
> invalid.fieldvalue my project (witch is based on struts2blank)
> throws-->  IllegalArgumentException: Cannot format given Object as a Number.
> Any body ? I am getting desperate and thinking of abandoning
> struts2.1.6 alltoghether....  :(
> Thank you in advance.
>
> Sergio.
>

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

Reply via email to