You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Lafredo, Stephen" <st...@merck.com> on 2003/04/09 00:56:44 UTC

Component Views and Tiles

Hi,

I am using Apache 1.3.20, Tomcat 4.0.4 and Struts 1.1-rc1.

I am attempting to port my existing JSP component view framework into Tiles.

I have succeeded so far but I am having trouble including in an include. For
example,

This is my tiles-def.xml

<tiles-definitions>
  <definition name="hlf"
              path="/WEB-INF/jsp/templates/hlf.jsp">
    <!-- head content -->
    <put name="meta-tags"       value="/WEB-INF/jsp/common/meta-tags.jsp" />
    <put name="page-directives"
value="/WEB-INF/jsp/common/page-directives.jsp" />
    <put name="head"
value="/WEB-INF/jsp/templates/portal/head.jsp" />

    <!-- body content -->
    <put name="header"  value="/WEB-INF/jsp/templates/portal/header.jsp" />
    <put name="footer"  value="/WEB-INF/jsp/templates/portal/footer.jsp" />
  </definition>

  <!-- sample report page -->
  <definition name="report"
           extends="hlf">
    <put name="subTitle" value="report.do action response" />
    <put name="layout"   value="/WEB-INF/jsp/templates/layout/plain.jsp" />
    <put name="content"  value="/WEB-INF/jsp/report/content.jsp" />
  </definition>

</tiles-definitions>

This is a portion of my primary template.

 </td></tr><tr><td>
   <%-- include the page layout --%>
   <tiles:insert attribute="layout" />
 </td></tr><tr><td>

This is the contents of plain.jsp

<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<%-- default page content, use it for displaying a one module --%>
<table summary="content" border="0" cellpadding="0" cellspacing="15"
width="100%">
  <tr><td>
  <hr color="#6fa399" />
  </td></tr>
  <tr><td width="100%" valign="top">
    <%-- include page content --%>
    <tiles:insert attribute="content" />
  </td></tr>
  <tr><td>
  <hr color="#d1d1d1" />
  </td></tr>
</table>

This all works pretty well. The report page is returned but the
<tiles:insert attribute="layout" /> line errors saying "content" is not
defined.

How do I either...

 1) pass the value of content to the plain.jsp by defining it w/in my
tiles-defs.xml file w/o using request parameters?

 2) define a new tile, (in my tiles-defs.xml?) and include it by definning
it w/in my tiles-defs.xml?

Thank you.

Stephen Lafredo
Merck & Co., Inc.
USHH IS Application Architecture, WP97-A315
V: (215) 652-2668
E: stephen_lafredo@merck.com



------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message.  If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.

==============================================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org