You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eric Rizzo <er...@opennetwork.com> on 2001/09/27 17:51:32 UTC

Nesting/overlapping templates

I want to nest a <template:insert> inside a <tempate:put> in order to use a 
template to specify part of the content of another template.
I started down the following road:

<!-- template.jsp -->
<html:html locale="true">
<head>
     <title><template:get name='title'/></title>
     <html:base/>
</head>

<p><template:get name="heading"/></p>

<p><template:get name="instructions"/></p>

<template:get name="form"/>

</body>
</html:html>


<!-- callingPage.jsp -->
<template:insert template='/template.jsp'>
     <template:put name='title'>
         <bean:message key="create.pageTitle"/>
     </template:put>

     <template:put name='heading'>
         <bean:message key="create.heading"/>
     </template:put>

     <template:put name='instructions'>
         <bean:message key="create.instructions"/>
     </template:put>

     <template:put name='form'>
         <template:insert template="/form.jsp">
             <template:put name="buttons">
                 <html:image page="/button.gif" />
             </template:put>
         </template:insert>
     </template:put>
</template:insert>


<!-- form.jsp -->
<html:form action="someAction.do">
     ...
     <template:get name="buttons">
     ...
</html:form>


Unfortunately, the above structure produces the "Illegal to flush inside a 
custom tag" exception.  Is it not possible to nest template insert's as I have 
done, or am I just doing something wrong?

TIA,
	Eric
-- 
Eric Rizzo, Software Engineer
OpenNetwork Technologies
http://www.opennetwork.com
-----------------------------
I embrace my personality flaws, for without them
I might have no personality at all.