Tiles insert with jspf components

S

sacrosby

I'm new to tiles, and I'm trying to understand why this doesn't work
properly. I'm using the Tiles Plugin in struts config so that I can
use a single template and just pop in the forms which I've got in jspf
files. If my 'inserted' components have a .jsp extension everything
works fine; however, if I use .jspf extension for components, the
custom tag stuff doesn't get rendered. I suppose this isn't a huge
problem (I could just rename the components to jsp extensions), but I'm
wondering if there is simply some kind tiles attribute I am missing or
something. I've seen some examples in other postings which appear to
use components with jspf extensions and don't have any problems.

Any ideas?

Regards,

S.

struts-config.xml
============
---
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config"
value="/WEB-INF/tileDefinitions.xml" />
<set-property property="definitions-debug" value="2" />
<set-property property="definitions-parser-details" value="2" />
<set-property property="definitions-parser-validate" value="true"
/>
</plug-in>
---

tileDefinitions.xml
=============
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">

<tiles-definitions>
<definition name="baseDef" path="/WEB-INF/jsp/layout.jsp">
<put name="header" value="/WEB-INF/jsp/pageBanner.jspf" />
<put name="footer" value="/WEB-INF/jsp/pageFooter.jspf" />
<put name="title" type="string" value="Untitled Document" />
</definition>

<definition name="tile.test" extends="baseDef">
<put name="title" type="string" value="Test Tiles" />
<put name="body" value="/WEB-INF/jsp/testFragment.jspf" /> <!--
this renders as typed below -->
</definition>
</tiles-definitions>

layout.jsp
=======
<%@ include file="elements/docType.jspf" %>
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<html:html locale="true" xhtml="true">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252" />
<title><tiles:getAsString name="title" /></title>
</head>
<body>
<tiles:insert attribute="header" />
<tiles:insert attribute="body" />
<tiles:insert attribute="footer" />
</body>
</html:html>

testFragment.jspf
=============
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<bean:message key="test.key" />
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top