spring - Apache Tiles 2.2.2 - propagating values -


<tiles-definitions>     <definition name="home" template="/web-inf/views/home.jsp">         <put-attribute name="title"       value="my app" />         <put-attribute name="header"      value="/web-inf/views/common/header.jsp" />         <put-attribute name="menu"        value="/web-inf/views/common/nav.jsp" />         <put-attribute name="footer"      value="/web-inf/views/common/footer.jsp" />     </definition> </tiles-definitions> 

how propagate title value (my app) header.jsp? in header jsp, when do:

<tiles:insertattribute name="title" ignore="true" /> 

nothing printed. when same in home.jsp, app printed. cascaded=true has not helped.

it's not clear tried putting cascade=true (assuming it's typo in question: should "cascade", not "cascaded") following works expected:

tiles.xml:

<tiles-definitions>     <definition name="home" template="/web-inf/views/home.jsp">         <put-attribute name="title"   value="my app" cascade="true"/>         <put-attribute name="header"  value="/web-inf/views/common/header.jsp" />         (...)     </definition> </tiles-definitions> 

home.jsp:

    title: <tiles:insertattribute name="title" /> <br/>     header: <tiles:insertattribute name="header" /> 

header.jsp:

title in header: <tiles:insertattribute name="title" /> 

the output is:

title: app header: title in header: app

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -