Quando tento acessar minha página aparece esse erro:
INFORMAÇÕES: javax.el.PropertyNotFoundException: /documento/introducao/Nome.xhtml @21,80 value="#{introducaoBean.introducao.nome}": Target Unreachable, identifier 'introducaoBean' resolved to null javax.el.PropertyNotFoundException: /documento/introducao/Nome.xhtml @21,80 value="#{introducaoBean.introducao.nome}": Target Unreachable, identifier 'introducaoBean' resolved to null
página Nome.xhtml
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<p:panelGrid id="painelNome" columns="1" style="width: 100%; margin-top: 20px">
<p:outputLabel value="1) NOME:" for="iNome" />
<p:inputText id="iNome" size="80" value="#{introducaoBean.introducao.nome}"/>
</p:panelGrid>
</ui:composition>
classe IntroducaoBean
import java.io.Serializable;
import javax.faces.view.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import br.net.palm.docforsystem.models.Introducao;
@Named
@ViewScoped
public class IntroducaoBean implements Serializable{
private static final long serialVersionUID = 1L;
private Introducao introducao;
public IntroducaoBean() {
this.introducao = new Introducao();
}
public void salvar() {
System.out.println("Deu certo até aqui!!!");
}
public Introducao getIntroducao() {
return introducao;
}
public void setIntroducao(Introducao introducao) {
this.introducao = introducao;
}
}
classe Introducao
import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.NotBlank;
@Entity
@Table(name="introducao")
public class Introducao implements Serializable{
private static final long serialVersionUID = 1L;
private Long id;
private String nome;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@NotBlank(message = "Nome do software é obrigatório")
@Size(max = 50)
@Column(nullable = false, length = 50)
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.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;
Introducao other = (Introducao) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
}