[英]Expression Error: Named Object: javax.faces.convert.IntegerConverter not found
Following is my code 以下是我的代码
<rich:select id="cycle_group" value="#{menuCycleBean.menuCycleDetailTO.menuCycleGroupId}" defaultLabel="#{msg['gobal.select.default.label']}"
converter="javax.faces.convert.IntegerConverter">
<f:selectItems value="#{menuCycleBean.cycleGroupList}" var="n" itemLabel="#{n.label}" itemValue="#{n.id}" />
</rich:select>
"menuCycleGroupId" is "Integer" Value and "n.id" is "String" value. “ menuCycleGroupId”为“整数”值,“ n.id”为“字符串”值。 I need to convert String to Integer.
我需要将String转换为Integer。 I am using following attribute
converter="javax.faces.convert.IntegerConverter"
, but it is giving error. 我正在使用以下属性
converter="javax.faces.convert.IntegerConverter"
,但它给出了错误。
Expression Error: Named Object: javax.faces.convert.IntegerConverter not found.
表达式错误:命名对象:找不到javax.faces.convert.IntegerConverter。
How can I use converter with <rich:select>
? 如何将Converter与
<rich:select>
?
The converter
attribute must point to either a concrete instance like #{bean.converter}
or contain a string literal with the converter ID and not the fully qualified converter class name. converter
属性必须指向#{bean.converter}
类的具体实例,或者包含具有转换器ID而不是标准转换器类名的字符串文字。 If you click through CONVERTER_ID
field constant in the standard converter's javadoc , then you'll find out that it's javax.faces.Integer
for the IntegerConverter
. 如果您通过点击
CONVERTER_ID
标准转换器的领域不断的javadoc ,那么你会发现 ,它的javax.faces.Integer
的IntegerConverter
。
So, this should do: 因此,应该这样做:
<rich:select ... converter="javax.faces.Integer" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.