Bonjour

J'ai un problème sur la navigation entre 2 pages, une fois que j'ai rentré les informations sur la 1ere page et que je clic sur le bouton Connecter, il ne se passe rien, j'ai trouvé une solution en mettant dans mon fichier faces-config.xml au lieux de mettre :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
<navigation-rule>
		<from-view-id>/Authentification.jsp</from-view-id>
		<navigation-case>
			<from-outcome>valide</from-outcome>
			<to-view-id>/Welcome.jsp</to-view-id>
		</navigation-case>
	</navigation-rule>
je remplace par :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
<navigation-rule>
		<from-view-id>*</from-view-id>
		<navigation-case>
			<from-outcome>valide</from-outcome>
			<to-view-id>/Welcome.jsp</to-view-id>
		</navigation-case>
	</navigation-rule>
Et ça fonctionne mais c'est pas très propre

voici mon code en entier :


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package beanPackage;
 
public class RegistrationBean {
private String email = "user@host";
private String pass = "****";
 
 
public String getEmail() {
	return email;
}
public void setEmail(String email) {
	this.email = email;
}
public String getPass() {
	return pass;
}
public void setPass(String pass) {
	this.pass = pass;
}
public String getMot() {
	return mot;
}
public void setMot(String mot) {
	this.mot = mot;
}
 
 
}

--


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8"?>

<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
	version="1.2">

 <navigation-rule>
		<from-view-id>/Authentification.jsp</from-view-id>
		<navigation-case>
			<from-outcome>valide</from-outcome>
			<to-view-id>/Welcome.jsp</to-view-id>
		</navigation-case>
	</navigation-rule> 



Code : Sélectionner tout - Visualiser dans une fenêtre à part
1234567891011121314151617181920212223
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="core" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="html" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Authentification JSF</title>
</head>
<body>
<core:view>
	<html:form>
		<html:outputText value="Hello World JSF" /><br>
		<html:outputText value="Adresse E-mail" />
		<html:inputText value="#{RegistrationBean.email}"/><br>
		<html:outputText value="Password" />
		<html:inputText value="#{RegistrationBean.pass}"/><br>
		<html:commandButton value="Connecter" action="valide"/>
	</html:form>
</core:view>
</body>
</html>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
123456789101112131415
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Welcome.jsp</title>
</head>
<body>
<f:view>
	<h:outputText value="Bienvenue #{RegistrationBean.email}"/>
</f:view>
</body>
</html>
<managed-bean> <managed-bean-name>RegistrationBean</managed-bean-name> <managed-bean-class>beanPackage.RegistrationBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> </faces-config>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version="1.0" encoding="UTF-8"?>
 
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
	version="1.2">
 
 <navigation-rule>
		<from-view-id>/Authentification.jsp</from-view-id>
		<navigation-case>
			<from-outcome>valide</from-outcome>
			<to-view-id>/Welcome.jsp</to-view-id>
		</navigation-case>
	</navigation-rule> 
 
 
	<managed-bean>
		<managed-bean-name>RegistrationBean</managed-bean-name>
		<managed-bean-class>beanPackage.RegistrationBean</managed-bean-class>
		<managed-bean-scope>session</managed-bean-scope>
	</managed-bean>
 
 
 
 
</faces-config>
Si qq à une petite idée
Merci