ATG Currency Converter Not Working With JSTL c:set

Currency conversion confusion on Flickr!

This JSP code was not outputting the properly formatted amount.

I tried forcing it by specifying the conversion parameters.

I then debugged atg.droplet.CurrencyTagConverter using Eclipse and found this code being executed.

public String convertObjectToString(DynamoHttpServletRequest pRequest,
                                 Object pValue, Properties pAttributes)
  throws TagConversionException
{
  if ((pValue == null) || (pValue instanceof String))
    return (String)pValue;

It turns out pValue was a String which is why it was never being formatted.  But why is it a String?

Well the code that sets dollars looks like this.




  

Apparently c:set converts the Double to a String.

To work around this problem I did this.

$

For further reading please see Tag Converters in the ATG Page Developer’s Guide.

Leave a Reply

Your email address will not be published. Required fields are marked *