在我的实体中:
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(unique=true, nullable=false)
private int tId;
....
public int getTId() {
return this.tId;
}
public void setTId(int tId) {
this.tId = tId;
}
我的 JSF 页面中的代码:
<ui:repeat value="#{techCat.techsOfCat}" var="post">
<h:outputText value="#{post.getTId()}"/>
...
</ui:repeat>
结果很好。但如果我编码:
<ui:repeat value="#{techCat.techsOfCat}" var="post">
<h:outputText value="#{post.tId}"/>
...
</ui:repeat>
我遇到了一个错误:
value="#{post.tId}": The class 'model.Technology' does not have the property 'tId'.
我真的不明白那个错误。你能给我解释一下吗?谢谢