Jean-Francois Leveque

Changement aiguillage initial

...@@ -5,7 +5,19 @@ ...@@ -5,7 +5,19 @@
5 http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" 5 http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
6 version="2.0"> 6 version="2.0">
7 7
8 - <navigation-rule> 8 + <navigation-rule>
9 + <from-view-id>/index.xhtml</from-view-id>
10 + <navigation-case>
11 + <from-outcome>addBook</from-outcome>
12 + <to-view-id>/book.xhtml</to-view-id>
13 + </navigation-case>
14 + <navigation-case>
15 + <from-outcome>listBooks</from-outcome>
16 + <to-view-id>/result.xhtml</to-view-id>
17 + </navigation-case>
18 + </navigation-rule>
19 +
20 + <navigation-rule>
9 <from-view-id>/book.xhtml</from-view-id> 21 <from-view-id>/book.xhtml</from-view-id>
10 <navigation-case> 22 <navigation-case>
11 <from-outcome>success</from-outcome> 23 <from-outcome>success</from-outcome>
......
1 <%@ page session="false" %> 1 <%@ page session="false" %>
2 <% 2 <%
3 - response.sendRedirect("book.jsf"); 3 + response.sendRedirect("index.jsf");
4 %> 4 %>
...\ No newline at end of file ...\ No newline at end of file
......
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 +<html xmlns="http://www.w3.org/1999/xhtml"
5 + xmlns:h="http://xmlns.jcp.org/jsf/html"
6 + xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
7 + xmlns:f="http://xmlns.jcp.org/jsf/core">
8 +<body>
9 +<h:form>
10 +<ul>
11 + <li>
12 + <h:commandLink action="addBook">
13 + <h:outputText value="Add book"/>
14 + </h:commandLink>
15 + </li>
16 + <li>
17 + <h:commandLink action="listBooks">
18 + <h:outputText value="List books"/>
19 + </h:commandLink>
20 + </li>
21 +</ul>
22 +</h:form>
23 +</body>
24 +</html>