tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon <spyd...@gmail.com>
Subject Problems with <insertTemplate> JSP tag
Date Tue, 13 Jan 2009 12:44:07 GMT
Hello !

I'm starting using Tiles 2 with a simple template JSP (in
/WEB-INF/tiles/template.jsp) :

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Application Title</title>

<!-- BEGIN CUSTOM HEAD -->

<tiles:insertAttribute name="tiles.head.data"/>

<!-- END CUSTOM HEAD -->

</head>
<body>

<!-- BEGIN CUSTOM BODY -->

<tiles:insertAttribute name="tiles.body.data"/>

<!-- END CUSTOM BODY -->

</body>
</html>


I'm trying to render the following JSP (in /WEB-INF/jsps/test.jsp) using the
previous template :

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>

<tiles:insertTemplate template="/WEB-INF/tiles/template.jsp">

<tiles:putAttribute name="tiles.head.data">

<meta lang="en" name="DESCRIPTION" content="Welcome to bla bla bla"/>
<meta lang="en" name="KEYWORDS" content="bla, bla, bla"/>

</tiles:putAttribute>

<tiles:putAttribute name="tiles.body.data">

<p>Bla bla bla bla</p>

</tiles:putAttribute>

</tiles:insertTemplate>


Unfortunately, the generated HTML is the following :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Application Title</title>

<!-- BEGIN CUSTOM HEAD -->

<meta lang="en" name="DESCRIPTION" content="Welcome to bla bla bla"/>
<meta lang="en" name="KEYWORDS" content="bla, bla, bla"/>

<!-- END CUSTOM HEAD -->

</head>
<body>

<!-- BEGIN CUSTOM BODY -->

<meta lang="en" name="DESCRIPTION" content="Welcome to bla bla bla"/>
<meta lang="en" name="KEYWORDS" content="bla, bla, bla"/>

<!-- END CUSTOM BODY -->

</body>
</html>


What am I doing wrong ?


Regards,

Simon

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message