[S2+Tiles2] Problème de définitions non trouvées.
Bonjour.
Je m'arrache les cheveux depuis quelques temps sur le problème suivant :
Contexte :
- Struts 2.0.7
- Struts 2 Tiles plugin - 2.0.7
- Tiles-API 2.0 20070207
- Tiles-Core 2.0 20070207
- Tomcat 5.5.20
- Windows XP pro.
- JDK 1.5.0_11
Le fichier web.xml :
Code:
1 2 3 4 5 6 7 8 9
|
<context-param>
<param-name>definitions-config</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
<listener>
<display-name>Tiles Listener</display-name>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener> |
Le fichier Tiles.xml (/WEB-INF/tiles.xml)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
...
<definition name="default" template="/WEB-INF/templates/template.jsp">
<put-attribute name="title" value="Default template"/>
<put-attribute name="header" value="/WEB-INF/atoms/header-default.jsp"/>
<put-attribute name="banner" value="/WEB-INF/atoms/banner-default.jsp"/>
<put-attribute name="menu" value="/WEB-INF/atoms/menu-default.jsp"/>
<put-attribute name="main" value="/WEB-INF/atoms/main-null.jsp"/>
<put-attribute name="footer" value="/WEB-INF/atoms/footer-default.jsp"/>
</definition>
<definition name="index" extends="default">
<put-attribute name="title" type="definition" value="Index page"/>
<put-attribute name="header" type="definition" value="/WEB-INF/atoms/header-default.jsp"/>
<put-attribute name="banner" type="definition" value="/WEB-INF/atoms/banner-default.jsp"/>
<put-attribute name="menu" type="definition" value="/WEB-INF/atoms/menu-default.jsp"/>
<put-attribute name="main" type="definition" value="/WEB-INF/atoms/main-default.jsp"/>
<put-attribute name="footer" type="definition" value="/WEB-INF/atoms/footer-default.jsp"/>
</definition>
... |
Le fichier template.jsp (/WEB-INF/templates/template.jsp)
Code:
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
|
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="tiles" uri="/WEB-INF/tiles-core.tld" %>
<s:url id="style" value="/css/style.css" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<s:head theme="xhtml" debug="false"/>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="${style}">
</head>
<body>
<div class="containeur">
<h1>Doh!</h1>
<h2><tiles:insertAttribute name="title"/></h2>
<tiles:insertAttribute name="header"/>
<tiles:insertAttribute name="banner"/>
<tiles:insertAttribute name="menu"/>
<tiles:insertAttribute name="main"/>
<tiles:insertAttribute name="footer"/>
</div>
</body>
</html> |
Et quand j'appelle une action qui me renvoie vers le tiles index, j'ai une erreur comme celle-ci pour chaque insertion :
Code:
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
|
10 avr. 2007 16:19:59 org.apache.tiles.taglib.ContainerTagSupport doEndTag
GRAVE: Error executing tag: Attribute 'title' not found.
org.apache.tiles.TilesException: Attribute 'title' not found.
at org.apache.tiles.taglib.InsertAttributeTag.render(InsertAttributeTag.java:93)
at org.apache.tiles.taglib.RenderTagSupport.execute(RenderTagSupport.java:122)
at org.apache.tiles.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:80)
at org.apache.jsp.WEB_002dINF.templates.be_jsp._jspx_meth_tiles_insertAttribute_0(be_jsp.java:176)
at org.apache.jsp.WEB_002dINF.templates.be_jsp._jspService(be_jsp.java:88)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at org.apache.tiles.context.servlet.ServletTilesRequestContext.include(ServletTilesRequestContext.java:181)
at org.apache.tiles.context.TilesRequestContextWrapper.include(TilesRequestContextWrapper.java:64)
at org.apache.struts2.tiles.StrutsTilesRequestContext.include(StrutsTilesRequestContext.java:120)
at org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesRequestContext.java:83)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:395)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:345)
at org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:104)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
...
10 avr. 2007 16:19:59 org.apache.tiles.taglib.RenderTagSupport doCatch
GRAVE: Error during rendering
javax.servlet.jsp.JspException: Error executing tag: Attribute 'title' not found.
at org.apache.tiles.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:84)
at org.apache.jsp.WEB_002dINF.templates.be_jsp._jspx_meth_tiles_insertAttribute_0(be_jsp.java:176)
at org.apache.jsp.WEB_002dINF.templates.be_jsp._jspService(be_jsp.java:88)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at org.apache.tiles.context.servlet.ServletTilesRequestContext.include(ServletTilesRequestContext.java:181)
at org.apache.tiles.context.TilesRequestContextWrapper.include(TilesRequestContextWrapper.java:64)
at org.apache.struts2.tiles.StrutsTilesRequestContext.include(StrutsTilesRequestContext.java:120)
at org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesRequestContext.java:83)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:395)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:345)
at org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:104)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
... |
Je n'arrive pas à trouver pourquoi il ne voit rien :'(
Merci pour votre aide.
PPDL