JSF f:convertNumber只在本地主机上正确地转换货币。

时间:2021-07-14 20:05:02

When using my app within the development environment, the currencies are all correctly converted by JSF. But when I deploy it to my production server, which is hosted somewhere else, the conversions are not correct (see below).

在开发环境中使用我的应用程序时,这些货币都是由JSF正确地转换的。但是,当我将它部署到我的生产服务器上时,它被托管在其他地方,转换是不正确的(见下文)。

I think the locale is correctly set by browser request (using the same browser)...
Is there anything else I could try to get JSF to convert the currency correctly?

我认为浏览器请求(使用相同的浏览器)正确设置了语言环境。我还可以尝试让JSF正确地转换货币吗?

Thank you!

谢谢你!

<f:convertNumber currencyCode="EUR" type="currency" />

On localhost: 1.231,34 €
On prod host: EUR1,231.34

The prod host converts it to American style, but I expected the German style.

prod主机将其转换为美式风格,但我期待的是德国风格。

1 个解决方案

#1


2  

i think you need to add the locale to the convertNumber tag. The prod server's JVM might be set to a different/default locale.

我认为您需要将区域设置添加到convertNumber标签。prod服务器的JVM可能被设置为不同的/默认地区。

#1


2  

i think you need to add the locale to the convertNumber tag. The prod server's JVM might be set to a different/default locale.

我认为您需要将区域设置添加到convertNumber标签。prod服务器的JVM可能被设置为不同的/默认地区。