Não fungou... Tentei declarar um atributo da classe Noticia do tipo TipoNoticia tbm nao rolou...
Invalid property 'TipoNoticia' of bean class [br.teste.bean.Noticia]: Bean property 'TipoNoticia' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
Classe TipoNoticia:
Code:
@Entity
public class TipoNoticia {
Integer idTipoNoticia;
String descricao;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
public Integer getIdTipoNotitica() {
return idTipoNoticia;
}
public void setIdTipoNoticia(Integer idTipoNoticia) {
this.idTipoNoticia= idTipoNoticia;
}
@DescriptionProperty
public String getDescricao() {
return descricao;
}
public void setDescricao(String descricao) {
this.descricao= descricao;
}
}
Classe Noticia:
Code:
@Entity
public class Noticia {
Integer idNoticia;
Integer idTipoNoticia;
String descricao;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
public Integer getIdNoticia() {
return idNoticia;
}
public void setIdNoticia(Integer idNoticia) {
this.idNoticia= idNoticia;
}
public Integer getIdTipoNoticia() {
return idTipoNoticia;
}
public void setIdTipoNoticia(Integer idTipoNoticia) {
this.idTipoNoticia= idTipoNoticia;
}
public String getDescricao() {
return descricao;
}
public void setDescricao(String descricao) {
this.descricao= descricao;
}
}
jsp noticiaEntrada.jsp:
Code:
<%@ taglib prefix="n" uri="neo"%>
<%@ taglib prefix="t" uri="template"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<t:entrada>
<t:janelaEntrada>
<t:tabelaEntrada>
<t:property name="idNoticia"/>
<t:property name="idTipoNoticia"/>
<t:property name="TipoNoticia" label="Tipo Noticia:"/>
<t:property name="descricao" label="Descrição:"/>
</t:tabelaEntrada>
</t:janelaEntrada>
</t:entrada>