Bonsoir,
au début je voulais travailler avec des facelets pour peupler mes pages jsf , mais le problème c'est que le jar des facelets me cause beaucoup de problèmes , c'est pour ça j'ai décidé de travailler avec tiles . là ma page est bien affichée avec le menu et le contenu mais lorsque je clique sur un boutton ou sur un truc dans mon menu , ma page se rafraichit et j’accède pas à la page voulu, je sais pas où ça se bloque
le contenu de mon web.xml
mon tiles-def.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
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 <?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="3.0" 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-app_3_0.xsd"> <display-name>Parametrage</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:application-context.xml</param-value> </context-param> <context-param> <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name> <param-value>com.sun.facelets.FaceletViewHandler</param-value> </context-param> <filter> <filter-name>RichFaces Filter</filter-name> <filter-class>org.ajax4jsf.Filter</filter-class> </filter> <filter-mapping> <filter-name>RichFaces Filter</filter-name> <servlet-name>Faces Servlet</servlet-name> </filter-mapping> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> <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> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.faces</url-pattern> </servlet-mapping> <servlet> <servlet-name>TilesServet</servlet-name> <servlet-class>org.apache.struts.tiles.TilesServlet</servlet-class> <init-param> <param-name>tiles-definitions</param-name> <param-value>/WEB-INF/tiles-def.xml</param-value> </init-param> <init-param> <param-name>definitions-parser-validate</param-name> <param-value>true</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> </web-app>
ma template topLayout.jsp :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration//EN" "http://jakarta.apache.org/struts/dtds/tiles-config.dtd"> <tiles-definitions> <!--Define each of your definitions here--> <definition name="template" path="/WEB-INF/tiles/topLayout.jsp"> <put name="header" value="/WEB-INF/tiles/header.jsp"/> <put name="menu" value="/WEB-INF/tiles/menu.jsp"/> <put name="content" value="content.jsp"/> <put name="footer" value="/WEB-INF/tiles/footer.jsp"/> </definition> </tiles-definitions>
l'appel dans ma page jsf :
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 <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %> <style> .tfooterPanel {text-align: center; width: 100%;} .tmainpage { width:765px;} .cmenu {width:210 ; vertical-align: top;} .cline {width:1 ; background-color:gray;} .ccontext {width:554 ; vertical-align: top; padding : 10 10 10 10; font-size:12; font-family: Arial, Helvetica, sans-serif;} </style> <html> <head> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0"> <f:view> <h:panelGrid border="0" columns="3" id="mainLayout" cellpadding="0" cellspacing="0" styleClass="tmainpage" footerClass="tfooterPanel" columnClasses="cmenu,cline,ccontext"> <f:facet name="header"> <f:subview id="header"> <tiles:insert page="/WEB-INF/tiles/header.jsp" flush="false"/> </f:subview> </f:facet> <h:panelGroup id="leftMenu"> <tiles:insert page="/WEB-INF/tiles/menu.jsp" flush="false"/> </h:panelGroup> <h:panelGroup id="verticalLine"> <h:graphicImage value="/images/spacer.gif" width="1" height="1"/> </h:panelGroup> <h:panelGroup id="pageContext"> <tiles:insert attribute="content" flush="false"/> </h:panelGroup> <f:facet name="footer"> <f:subview id="footer"> <tiles:insert page="/WEB-INF/tiles/footer.jsp" flush="false"/> </f:subview> </f:facet> </h:panelGrid> </f:view> </body> </html>
avec mes composante menu,content, développées en richfaces , si quelqu'un a déjà travaillé avec jsf/richfaces/tiles , peut me dire comment il a procédé et où se trouve l'erreur exactement.merci d'avance
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 <%@ 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"%> <%@ taglib prefix="a4j" uri="http://richfaces.org/a4j"%> <%@ taglib prefix="rich" uri="http://richfaces.org/rich"%> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Liste des directions</title> </head> <f:view> <body style="margin:0px; padding:0px" onload="onLoadFunctions();" onunload="onUnloadFunctions();"> <f:subview id="home"> <tiles:insert page="/WEB-INF/tiles/topLayout.jsp" flush="false"> <tiles:put name="content" value="directionList.jsp" /> <tiles:put name="menu" value="/WEB-INF/tiles/menu.jsp"/> </tiles:insert> </f:subview> </body> </f:view> </html>
Partager