struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diego Manilla Suárez <diego.mani...@xeridia.com>
Subject Transform values - Type conversion
Date Mon, 01 Feb 2010 08:58:03 GMT
Hi. I have a simple problem: I need to divide by 100 user's input in 
some fields when I'm going to store values in DB and perform the 
opposite operation when loading the form again.

I thought Struts 2 type conversion was what I needed, so I created a 
simple PercentageConverter, implementing convertFromString and 
convertToString to divide by 100 and multiply by 100, respectively. The 
first operation is performed fine, the problem is that convertToString 
is never being called. I think it has to do with the fact that the 
fields are strings themselves, so Struts thinks a conversion is not needed.

What can I do to solve this problem? I'm looking for the simplest 
solution possible.

Thanks in advance.****
****

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


Mime
View raw message