Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

BigDecimal in DynaActionForm "" instead of null

uni

2007-01-14

Replies:

Hi,

I have an DynaActionForm (using Struts 1) with several properties, all of type
String. My business object is typed; one of its properties is a BigDecimal. To
copy form data to the entity, I'm using BeanUtils.copyProperties. This works
well, but in case of BigDecimals, there is a conversion error because the form
returns an empty string instead of null. I tried to set the "convertNull"
parameter of the ActionServlet, but this didn't change the behavior. Now I have
a workaround (setting the form properties manually to null before using
BeanUtils), but I do not consider this the best solution. Is there a better
solution for this issue?

Cheers,

Thorsten


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.