You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Brown, Robert" <Ro...@Arbella.com> on 2004/10/07 16:06:27 UTC

Problem sharing Tiles between applications

Greetings:

   Perhaps you can help me with a real problem I am having using Tiles.

   I have an understanding of how to use Tiles; I have several pages that
use several parts of JSPs, as illustrated by the example below:

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

<tiles:insert page="/layouts/mainlayout.jsp" flush="true">
<tiles:put name="title" value="Typical Title of Page" />
<tiles:put name="banner" value="/parts/toppart.jspf" />
<tiles:put name="menu" value="/parts/menu.jspf" />
<tiles:put name="content" value="/content/mainpg.jspf" />
<tiles:put name="footer" value="/parts/footer.jspf" />
</tiles:insert>

The names of the JSPs (and the parameters) should speak for themselves.

   I have several pages within my application which reuse the "banner",
"menu", and "footer" pages. My problem arises when I attempt to use these
same pages in another application.

   What I tried to do is create another application and have it point to the
same "banner", "menu", and "footer" pages. The exact pages. What I want to
do is have a common directory that has toppart.jspf, menu.jspf, and
footer.jspf, and have more than one application go to that directory for
those files. 

   Unfortunately, it appears that the different applications always look for
a subdirectory under their context root for the files in question --
especially if those applications are packaged in EAR files. When I try to
make one application go to another for the JSPs in question, an exception is
thrown because the <tiles:insert> tag cannot fnd the files.

   Has anyone else run into this problem that you know of? Is there a
possible solution? I would rather be able to reuse parts of JSPs between
applications; after all, the banner, menu, and footer are common across the
applications they will be used for. I do not want to have to have multiple
copies of these files; after all, isn't that what Tiles is supposed to help
avoid???

   Can you give some insight into this matter? Thank You.

-Robert Brown III

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