Bonjour tous le monde .
J'ai des problèmes lorsque j'essaie d'utiliser les facelets avec JSF.

- le fichier "web.xml":
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
 
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>test</display-name>
 
  <context-param>
     <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
     <param-value>.xhtml</param-value>
  </context-param>
 
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
  </servlet-mapping>
 
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>
 
</web-app>
- le fichier "face-config.xml":
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
 
<?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">
 
   <application>
      <!-- tell JSF to use Facelets -->
      <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
   </application>
 
</faces-config>
la page d'accueil "index.html":
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
	"http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head><title>Start Web Application</title>
 <meta http-equiv="Refresh" content= "2; URL=page.faces"/>
</head>
<body>
 <h1>Please wait for the web application to start.</h1>
</body>
</html>
- "page.xhtml":
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My First Facelet</title>
</head>
<body>
	  Hello world.
</body>
</html>
Lorsque j'exécute l'application sur Jboss j'aurai le message suivant:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
Etat HTTP 404 - /test/
type Rapport d'état 
   message /test/
description 
   La ressource demandée (/test/) n'est pas disponible.
 
JBossWeb/2.0.0.GA
vos aides svp !!
est ce qu'il y a quelqu'un qui a des exemples avec JSF/facelets !! ça peut m'aider énormément.
merci d'avance . . .