I am having a problem with the tile definitions and the paths contain therein.

My dev directory is setup:
web \
    + WEB-INF \
    |         \ tiles-def.xml
    + _common \
    |         + layouts \
    |                   \ mainLayout.jsp        
    |                   + tiles \
    |                           \ _header.jsp
    |                           \ _footer.jsp
    + pages \
            \ Test.jsp

I can create jsp pages which use tiles via the insert method. However when I try to use a definition file things fall apart.

I have the tiles-def.xml in WEB-INF and in there is defined
<tiles-definitions>
  <!-- main layout -->
  <definition name="main.layout" path="../_common/layouts/mainLayout.jsp">
    <put name="header" value="../_common/layouts/tiles/_header.jsp"/>
    <put name="footer" value="../_common/layouts/tiles/_footer.jsp" />
  </definition>

  <!-- test page -->
  <definition name="test.page" extends="main.layout">
  </definition>
</tiles-definitions>

So essentially when test.page is created it will create a page with the just header and footer. This is a test to get it working only - all the other stuff (body, etc.) has been stripped out.

mainLayout.jsp consists of
  <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
  <tiles:insert attribute="header" />
  <tiles:insert attribute="footer" />

and Test.jsp is only
  <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
  <tiles:insert definition="test.page" />

Now nothing appears when I try to open Test.jsp from a page that has uses the <tiles:insert> method - the file is empty, no errors or anything. I have the feeling it is something to do with paths but removing ../ and various combinations doesn't seem to work.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to