W
WJ
I've worked with struts a bit and am relatively new to Tiles.
I've created a tile page that has a layout of a header and body, and need to
pass a parameter to the header
to change it's behavior.
I have a simple layout page, called layout.jsp, like this:
<!--included taglibs omitted -->
<html>
<head>
<title><tiles:getAsString name="title" /></title>
</head>
<body>
<table border="1" cellspacing="0" cellpadding="0">
<tr>
<td>
<tiles:insert attribute="header" />
</td>
</tr>
<tr>
<td>
<tiles:insert attribute="body" />
</td>
</tr>
</table>
</body>
</html>
I have a Tile page called tile.jsp, like this:
<%@ taglib uri="struts-tiles.tld" prefix="tiles" %>
<tiles:insert page="layout.jsp" flush="true">
<tiles
ut name="header_type" content="1"/>
<tiles
ut name="title" value="My Test Tile" />
<tiles
ut name="header" value="header.jsp" />
<tiles
ut name="body" value="body.jsp" />
</tiles:insert>
In my header.jsp, I have one relevant line:
<tr><td>==><tiles:getAsString name="header_type" /><==</td></tr>
body.jsp doesn't matter.
I expect to see at the top of my page ==>1<==. Everything works fine,
except, I get
==><== (with no '1'). In fact,
if I don't put an igore="true" I get an error (because the attribute was not
found).
How do I pass a value along the Tiles Context to the header.jsp?
I've also tried using tiles inside the body.jsp, like this:
<tr>
<td>
<tiles:insert page="header.jsp">
<tiles
ut name="title" value="Test from body.jsp" />
<tiles
ut name="header_type" value="1" />
</tiles:insert>
</td>
</tr>
I've created a tile page that has a layout of a header and body, and need to
pass a parameter to the header
to change it's behavior.
I have a simple layout page, called layout.jsp, like this:
<!--included taglibs omitted -->
<html>
<head>
<title><tiles:getAsString name="title" /></title>
</head>
<body>
<table border="1" cellspacing="0" cellpadding="0">
<tr>
<td>
<tiles:insert attribute="header" />
</td>
</tr>
<tr>
<td>
<tiles:insert attribute="body" />
</td>
</tr>
</table>
</body>
</html>
I have a Tile page called tile.jsp, like this:
<%@ taglib uri="struts-tiles.tld" prefix="tiles" %>
<tiles:insert page="layout.jsp" flush="true">
<tiles
<tiles
<tiles
<tiles
</tiles:insert>
In my header.jsp, I have one relevant line:
<tr><td>==><tiles:getAsString name="header_type" /><==</td></tr>
body.jsp doesn't matter.
I expect to see at the top of my page ==>1<==. Everything works fine,
except, I get
==><== (with no '1'). In fact,
if I don't put an igore="true" I get an error (because the attribute was not
found).
How do I pass a value along the Tiles Context to the header.jsp?
I've also tried using tiles inside the body.jsp, like this:
<tr>
<td>
<tiles:insert page="header.jsp">
<tiles
<tiles
</tiles:insert>
</td>
</tr>