【发布时间】:2011-08-31 04:40:31
【问题描述】:
我将 Status 对象传递给 h:commandLink 值。所以它显示在页面上。问题是,显示的字符串是
packages.entity.Status@db2674c8。
我用注释为Status 创建了转换器
@FacesConverter(forClass = Status.class, value = "statusConverter")
但它不起作用。我试图明确设置它:
<h:commandLink value="#{result.status}" action="/view">
<f:converter converterId="statusConverter" />
</h:commandLink>
然后报错:/search-form.xhtml @57,58 <f:converter> Parent not an instance of ValueHolder: javax.faces.component.html.HtmlCommandLink@53e387f3
这是真的,h:commandLink 不是ValueHolder。有什么方法可以转换 h:commandLink 的值吗?
【问题讨论】: