[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    formatting money values with bean:write
From:       Adam Lipscombe <adam.lipscombe () expensys ! com>
Date:       2007-01-31 5:25:46
Message-ID: 45C0285A.8050807 () expensys ! com
[Download RAW message or body]

Folks


I am using "<bean:write name="myBean" property="myBeanProperty" formatKey="global.moneyFormat"/>

global.moneyFormat is defined in the vanilla ApplicationResources.properties file as "#,##0.00"

To support users in France and Germany there are also ApplicationResources_fr and 
ApplicationResources_de property files. These define the moneyFormat as "# ##0,00" and "#.##0,00". 
This all works fine.


But, when a user accesses the system from a client whose locale uses a non-USA/UK style currency 
format string and the locale is NOT France or Germany (e.g. "#.##0,00" - Portugal or Brazil) the 
system fails with "javax.servlet.ServletException: Wrong format string: '#,##0.00'"


I think what is happening is that the system is using the default "global.moneyFormat" property 
String from the vanilla ApplicationResources file (which is what I would expect).
But when this default pattern is applied it does not match the one expected by the client-side 
locale and so the pattern application fails.


What I thought was supposed to happen was that if an appropriate ApplicationResources_XX.properties 
file could not be found the "global.moneyFormat" property from the vanilla properties file would be 
used and simply applied?


Does anyone know what is supposed to happen?
Is it necessary to have a separate ApplicationResources_XX props file for every locale that might 
access the system? Surely not?


TIA - Adam


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic