开发者

jsf 2.0 @FacesConverter forClass BigDecimal not working?

I'm using Mojarra 2.1.3 (FCS b02) on Glassfish 3.1.1. When I use

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

but when I change to:

@FacesConverter("priceConverter")
...
<h:outputText开发者_如何转开发 value="#{product.netValue}" converter="priceConverter"/>

It works. Is there a bug in Mojarra? I also use @FacesConverter(forClass=String.class) with no problem. Only BigDecimal is not working.


I'm not sure how mojarra handles multiple converters for the same type. JSF comes with a default BigDecimalConverter. If i have to guess i would say that the jsf converter is used instead of yours

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜