开发者

jsf 2.0 @FacesConverter forClass BigDecimal not working?

开发者 https://www.devze.com 2023-04-05 02:36 出处:网络
I\'m using Mojarra 2.1.3 (FCS b02) on Glassfish 3.1.1. When I use @FacesConverter(forClass=BigDecimal.class)

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

精彩评论

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