Ola estou começando tb e estou com esse mesmo problema nao sei como resolver…alguem poderia por gentileza dar uma força?
erro:
javax.servlet.ServletException: javax.servlet.ServletException: /publico/projeto.xhtml @34,99 value="#{projetoBean.projeto.detalhamento}": The class ‘financeiro.projeto.Projeto’ does not have the property ‘detalhamento’.
ProjetoBean
package financeiro.web;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import financeiro.projeto.Projeto;
import financeiro.projeto.ProjetoRN;
import financeiro.util.ContextoUtil;
@ManagedBean(name=“projetoBean”)
@RequestScoped
public class ProjetoBean {
private Projeto projeto = new Projeto();
private List<Projeto> lista = null;
private String destinoSalvar;
public void salvar() {
ContextoBean contextobean = ContextoUtil.getContextoBean();
this.projeto.setUsuario(contextobean.getUsuarioLogado());
ProjetoRN projetoRN = new ProjetoRN();
projetoRN.salvar(this.projeto);
this.projeto = new Projeto();
this.lista = null;
}
public String excluir(){
ProjetoRN projetoRN = new ProjetoRN();
projetoRN.excluir(this.projeto);
this.lista = null;
return null;
}
public List<Projeto> getLista() {
if(this.lista == null){
ProjetoRN projetoRN = new ProjetoRN();
this.lista = projetoRN.listar();
}
return this.lista;
}
public void setLista(List<Projeto> lista) {
this.lista = lista;
}
public Projeto getProjeto() {
return this.projeto;
}
public void setProjeto(Projeto projeto) {
this.projeto = projeto;
}
public String getDestinoSalvar() {
return destinoSalvar;
}
public void setDestinoSalvar(String destinoSalvar) {
this.destinoSalvar = destinoSalvar;
}
}
Projeto:
package financeiro.projeto;
import <a href="http://java.io">java.io</a>.<em>;
import java.util.</em>;
import javax.persistence.*;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import financeiro.usuario.Usuario;
@Entity
public class Projeto implements Serializable{
@Id
@GeneratedValue
@org.hibernate.annotations.NaturalId
private Integer codigo;
@ManyToOne
@OnDelete(action=OnDeleteAction.CASCADE)
@JoinColumn(name = "codSolicitante", nullable = true)
private Usuario usuario;
private String descricao;
private String status;
@Column(name="dtCadastro", nullable = true, updatable = false)
private Date dtCadastro;
private String detalhamento;
/*private String receberproposta;
private String orcamento;
private String prazo;
private String tecnologia;
private String plataforma;
private String linguagem;*/
public Integer getCodigo() {
return codigo;
}
public void setCodigo(Integer codigo) {
this.codigo = codigo;
}
public Usuario getUsuario() {
return usuario;
}
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
public String getDescricao() {
return descricao;
}
public void setDescricao(String descricao) {
this.descricao = descricao;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Date getDtCadastro() {
return dtCadastro;
}
public void setDtCadastro(Date dtCadastro) {
this.dtCadastro = dtCadastro;
}
public String getDetalhamento() {
return detalhamento;
}
public void setDetalhamento(String detalhamento) {
this.detalhamento = detalhamento;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((codigo == null) ? 0 : codigo.hashCode());
result = prime * result
+ ((descricao == null) ? 0 : descricao.hashCode());
result = prime * result
+ ((detalhamento == null) ? 0 : detalhamento.hashCode());
result = prime * result
+ ((dtCadastro == null) ? 0 : dtCadastro.hashCode());
result = prime * result + ((status == null) ? 0 : status.hashCode());
result = prime * result + ((usuario == null) ? 0 : usuario.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Projeto other = (Projeto) obj;
if (codigo == null) {
if (other.codigo != null)
return false;
} else if (!codigo.equals(other.codigo))
return false;
if (descricao == null) {
if (other.descricao != null)
return false;
} else if (!descricao.equals(other.descricao))
return false;
if (detalhamento == null) {
if (other.detalhamento != null)
return false;
} else if (!detalhamento.equals(other.detalhamento))
return false;
if (dtCadastro == null) {
if (other.dtCadastro != null)
return false;
} else if (!dtCadastro.equals(other.dtCadastro))
return false;
if (status == null) {
if (other.status != null)
return false;
} else if (!status.equals(other.status))
return false;
if (usuario == null) {
if (other.usuario != null)
return false;
} else if (!usuario.equals(other.usuario))
return false;
return true;
}
}
XHTML
<h:outputLabel value="Detalhamento do Projeto:" for="detalhamento"/>
<h:inputTextarea id="textArea" rows="4" cols="23" value="#{projetoBean.projeto.detalhamento}">
</h:inputTextarea>