En me référant à cette erreur :
javax.el.PropertyNotFoundException: /index.xhtml @67,99 action="#{livroController.prepararAdicionarLivro}": Target Unreachable, identifier 'livroController' resolved to null
Je viens de suivre ton tutoriel, mais en ayant crée un projet maven, pour pas avoir à aller chercher les librairies nécessaires à la main, et j'ai mis dans mon index.xhtml le strict minimum pour juste voir que mon contrôleur était appelé et ça a bien marché. On va faire des tous petits tests suivants, mets ceci dans ton index.xhtml :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>Gerenciador de Livros</title>
</h:head>
<h:body>
<h1>Gerenciador de Livros</h1>
<br/>
<h:outputText value="#{livroController.titreProjet}"/>
</h:body>
</html> |
Et dans ton controller tu déclares ceci :
1 2 3 4 5 6 7 8 9
|
private String titreProjet="Livre En Location";
...
public String getTitreProjet() {
return titreProjet;
}
public void setTitreProjet(String titreProjet) {
this.titreProjet = titreProjet;
} |
Tu relances et dis nous ce qu'affiche cette page.
Partager