【问题标题】:jsf 2.0 @FacesConverter forClass BigDecimal not working?jsf 2.0 @FacesConverter forClass BigDecimal 不起作用?
【发布时间】:2011-11-18 12:49:21
【问题描述】:

我在 Glassfish 3.1.1 上使用 Mojarra 2.1.3 (FCS b02)。 当我使用

@FacesConverter(forClass=BigDecimal.class)
...
<h:outputText value="#{product.netValue}"/>

但是当我改为:

@FacesConverter("priceConverter")
...
<h:outputText value="#{product.netValue}" converter="priceConverter"/>

它有效。 Mojarra 中是否存在错误? 我也毫无问题地使用@FacesConverter(forClass=String.class)。只有 BigDecimal 不起作用。

【问题讨论】:

    标签: jakarta-ee jsf-2 mojarra


    【解决方案1】:

    我不确定 mojarra 如何处理同一类型的多个转换器。 JSF 带有一个默认的 BigDecimalConverter。如果我不得不猜测,我会说使用的是 jsf 转换器而不是你的

    【讨论】:

      猜你喜欢
      • 2012-04-30
      • 2015-10-14
      • 1970-01-01
      • 2012-10-22
      • 2020-03-08
      • 1970-01-01
      • 2013-03-08
      • 2021-10-29
      • 1970-01-01
      相关资源
      最近更新 更多