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
精彩评论