Tiles/include (with code...)

D

Daniel

(Sorry, I forgot to post the code in my previous post...here it is...)


I am using Tiles with Struts.

In Tiles, I have a common layout page which all other pages use. The common
layout page has an include at the top of the page. I have three other
sections in the page including a menu, the body, and the footer.

The problem I am having is that the include at the top of the page has
imports, taglib definitions, and Java objects that I need for the rest of
the page, including the part for the menu, body, and footer. However, when I
try to view those pages, I get an error because one or all of those
mini-sections (menu, body, footer) complains it cannot find an object or
something (the object was defined in the include file!).

Am I missing something?

Here's the common layout page:

<%@ include file="../include/MasterInclude.jsp"%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title><tiles:getAsString name="title"/></title>
<link rel="stylesheet" type="text/css"
href="<%=request.getContextPath()%>/layout/main.css">
</head>
<body leftmargin="0" rightmargin="0" topmargin="0">

<table border="0" width="100%">
<tr>
<td>
<center>
<tiles:insert name="Header.jsp"/>
</center>
</td>
</tr>
<tr>
<td>
<center>
<tiles:insert name="body"/>
</center></td>
</tr>
<tr>
<td>
<center>
<tiles:insert page="Footer.jsp"/>
</center>
</td>
</tr>
</table>
</body>
</html>
 
C

cchang

I am repasting from a recent post so pardon my redundancy.

First, let me begin by noting that I work for M7. NitroX, the Struts
version has very nice support for Tiles including design time
edits/views. One nice feature about NitroX is it's ability to detect
inconsistencies/errors that span the web app - at design time.
Whether the problem is in the include file, xml config file, etc.
NitroX scans the web app and determines inconsistency errors, syntax
errors, etc.

If you're using eclipse, this will be easier to try. If not, a little
harder - but we include eclipse in larger download.

You can download the trial and see if NitroX can automatically find
the errors and if you like it, we'd appreciate the business or some
kind words.

You can see some of the tiles support here:
http://www.m7.com/tiles.htm

You can download here: www.m7.com/free
I'd recommend the free JSP Editor since it includes trial capabilities
for the Struts IDE and JSP IDE.

good luck
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top