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
| <?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:
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:
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> |