struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yasser Zamani <yasserzam...@apache.org>
Subject Re: Struts 2.6
Date Tue, 28 Nov 2017 08:45:36 GMT


On 11/28/2017 11:51 AM, Greg Huber wrote:
> Is there any way I can
> now easily do this?

I think you can write a small custom converter via extending 
`com.opensymphony.xwork2.conversion.impl.StringConverter` and overriding 
it's `convertToString` method [1] then you can register it globally for 
java.lang.Double types via a file named `xwork-conversion.properties` in 
your resources folder [2] which contains:

java.lang.Double=com.mycompany.myDoubleWithDotZerroConverter

[1] 
https://github.com/apache/struts-examples/blob/master/type-conversion/src/main/java/org/apache/struts/example/ThemeDescriptorConverter.java
[2] 
https://github.com/apache/struts-examples/blob/master/type-conversion/src/main/resources/xwork-conversion.properties

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

Mime
View raw message