If you use the tiles-config.xml file, you can try to add one definition level:

<definition name="header.selectPage" path="/selectPage.jsp" >
<tiles:put name="page" value="" />
</definition>

<definition name="header.selectPage" extends="selectPage" >
<tiles:put name="page" value="header.jsp" />
</definition>

<definition name="footer.selectPage" extends="selectPage" >
<tiles:put name="page" value="footer.jsp" />
</definition>

....

Cedric

[EMAIL PROTECTED] wrote:

Is there a way to pass a parameter to each tile in the def file?
I am using tiles to do the layout of my page, but I do not know until
runtime what my header, footer, etc pages are. I have a javabean in the
session scope that figures this out. The bean works with a jsp:include
in the "selectPage.jsp"

This bean is passed the "page" value, it will then look in the
filesystem for the most appropriate file (based upon group membership).

This is basically what I would like to be able to define in my tiles
defs file: Keep in mind that the "page" property can't be renamed or I
would have to have a different target jsp tile.

<tiles:insert page="/layout/classicLayout.jsp" flush="true">
<tiles:put name="title" value="My first page" />
<tiles:put name="header" value="/selectPage.jsp">
<!-- set some static string property here that selectPage can get
--> <property:set name="page" value="header.jsp"/>
</tiles:put>
<tiles:put name="footer" value="/selectPage.jsp">
<!-- set some static string property here that selectPage can get
--> <property:set name="page" value="footer.jsp"/>
</tiles:put>
<tiles:put name="menu" value="/selectPage.jsp">
<!-- set some static string property here that selectPage can get
--> <property:set name="page" value="menu.jsp"/>
</tiles:put>
<tiles:put name="body" value="/selectPage.jsp">
<!-- set some static string property here that selectPage can get
--> <property:set name="page" value="body.jsp"/>
</tiles:put>
</tiles:insert>


I would sincerely appreciate any help or guidance in getting the best
solution.

Phillip




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




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

Reply via email to