struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milan Milanovic <milanmilanov...@yahoo.com>
Subject Re: [S2] Double conversion issue
Date Tue, 26 Aug 2008 14:24:31 GMT

I put in my MyActionClass-conversion.properties file like this:

prop = com.myProject.conversions.DoubleConverter

But when user click on the "Delete" link, it is the same, 0 is added at the
end of the Double, so I supose that this converter is not called, as prop is
send through params ? It seems that these converters works only for form
fields ?

--
Milan  



Milan Milanovic wrote:
> 
> I have defined new DoubleConverter, but now I don't know how to define
> conversion in MyActionClass-conversion.properties file. I know how to
> define it for form fields, but how to define it for a link, like below:
> 
> <s:url id="removeUrl" action="remove"> 
>     <s:param name="prop" value="prop" /> 
> </s:url> 
> <s:a id="a_%{prop}" href="%{removeUrl}" theme="ajax"
> notifyTopics="/delete" targets="fruits">Delete</s:a> 
> 
> ?
> 
> "prop" is Double.
> 
> --
> Thx, Milan
> 
> 
> 
> Jeromy Evans - Blue Sky Minds wrote:
>> 
>> Milan Milanovic wrote:
>>> Uf, bug again :-(((.
>>>
>>> Is there any custom type-converter for Double-s that doesn't have this
>>> error
>>> ?
>>>
>>> --
>>> Milan
>>>   
>> 
>> A custom type-converter means you can write one yourself for that 
>> specific property.  It's very simple:
>> 
>> http://struts.apache.org/2.0.11.2/docs/type-conversion.html
>> 
>> Personally I never use Double in an action and instead opt for 
>> BigDecimal to maintain precision correctly.
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Double-conversion-issue-tp19092842p19163084.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message