I'm trying to make a very simple couple of HTML pages with JSF, to search for something in a database, but for some reason, when I hit the submit button, nothing happens. The text input goes empty and nothing else happen. It should go to another page displaying the results.
Here are my files :
index.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsf="http://xmlns.jcp.org/jsf">
<head>
<meta charset="ISO-8859-1">
<title>Accueil</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="card">
<h1>Cinésthésie</h1>
<form jsf:id="Form_Recherche">
<div class="inputWrapper">
<input type="text" id="recherche" jsf:value="beanFilm.recherche" required><label>Que recherchez-vous ?</label>
</div>
<input type="submit" value="" id="searchButton" jsf:action="#{beanFilm.doRecherche}"/>
</form>
</div>
</body>
</html>
face-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
<managed-bean>
<managed-bean-name>beanFilm</managed-bean-name>
<managed-bean-class>bean.BeanFilm</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<display-name>index.html</display-name>
<from-view-id>/index.html</from-view-id>
<navigation-case>
<from-outcome>toResultatsRecherche</from-outcome>
<to-view-id>/resultatsRecherche.html</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
BeanFilm.java
public class BeanFilm implements Serializable {
private static final long serialVersionUID = 1L;
private String recherche = new String();
public String getRecherche() {
return recherche;
}
public void setRecherche(String recherche) {
this.recherche = recherche;
}
public String doRecherche() {
return "toResultatsRecherche";
}
public List<Film> getResultatsRecherche() {
return DAOFilmJPA.getInstance().getFilmsByTitle(recherche);
}
}
I've been trying for hours now, I must have missed an important point I guess. Any idea ?