我的第一个自定义转换器:为什么不被调用? [英] My first custom converter: why's not called?
问题描述
我写了我的第一个JSF(1.2)定制转换器。
我在faces-config.xml中声明了它( converter-id
和 converter-class
),写道实现getAsObject和getAsString方法的Java类。
然后我将转换器放在这样的页面中:
I wrote my first JSF (1.2) custom converter.
I declared it in faces-config.xml (converter-id
and converter-class
), wrote the Java class implementing getAsObject and getAsString methods.
Then i put the converter in a page like this:
<ice:selectInputDate id="ctldatanascita"
value="#{beanrichiestaabilitazione.datanascita}"
renderAsPopup="true">
<f:converter converterId="cisConverterDate" />
</ice:selectInputDate>
该类被设置,但是从不调用Converter接口方法。
我缺少了什么?
The class is istantiated, but the Converter interface methods are never called. What I'm missing?
推荐答案
我不做IceFaces,所以我无法从顶部分辨正常的话但是在 ice:selectinputdate转换器 上搜索时,我将其引向首次点击: http://www.icefaces.org/JForum/posts/list/ 6163.page 确认您所看到的行为。
I don't do IceFaces, so I can't tell from top of head if that is normal. But Googling on "ice:selectinputdate converter" leads me to this topic as first hit: http://www.icefaces.org/JForum/posts/list/6163.page which confirms the behaviour you're seeing.
它还提到了几个先决条件和解决方案:
It als mentions several prerequirements and solutions:
- 您至少需要ICEfaces 1.7 DR2或ICEfaces 1.6.2。
- 您的转换器需要扩展
javax.faces.convert.DateTimeConverter
。 - 或仅使用标准 <$ c而是$ c>< f:convertDateTime> 。
- You need at least ICEfaces 1.7 DR2 or ICEfaces 1.6.2.
- Your converter needs to extend
javax.faces.convert.DateTimeConverter
. - Or just use standard
<f:convertDateTime>
instead.
这篇关于我的第一个自定义转换器:为什么不被调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!