简体   繁体   English

表达式错误:命名对象:找不到javax.faces.convert.IntegerConverter

[英]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.IntegerIntegerConverter

So, this should do: 因此,应该这样做:

<rich:select ... converter="javax.faces.Integer" />

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 javax.faces.FacesException:表达式错误:命名对象:找不到播放器 - javax.faces.FacesException: Expression Error: Named Object: player not found javax.faces.FacesException:表达式错误:命名对象:net.bootsfaces.layout.Well not found - javax.faces.FacesException: Expression Error: Named Object: net.bootsfaces.layout.Well not found 获取表达式错误:命名对象:找不到javax.faces.ComponentResourceContainer。 什么时候使用素面? - getting Expression Error: Named Object: javax.faces.ComponentResourceContainer not found. when using primefaces? javax.faces.FacesException:表达式错误:命名对象:org.omnifaces.component.validator.ValidateMultiple 未找到 - javax.faces.FacesException: Expression Error: Named Object: org.omnifaces.component.validator.ValidateMultiple not found JSF javax.faces.convert转换器getAsString对象null - JSF javax.faces.convert Converter getAsString Object null Class 未找到异常:javax/faces/component/UIComponent - Class not found exception : javax/faces/component/UIComponent FacesException:表达式错误:命名对象:位于WEB-INF / libs /中时找不到xxx - FacesException: Expression Error: Named Object: xxx not found when located in WEB-INF/libs/ 表达式错误:命名对象:ch.foo.EnitityConverter@f163464 - Expression Error: Named Object: ch.foo.EnitityConverter@f163464 not found CDI @Named bean 中的 @javax.faces.bean.ManagedProperty 返回 null - @javax.faces.bean.ManagedProperty in CDI @Named bean returns null javax.faces.convert.ConverterException:无法理解为货币值 - javax.faces.convert.ConverterException: could not be understood as a currency value
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM