struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmk...@earthlink.net (David M. Karr)
Subject Tiles: pass "title" value to header page
Date Wed, 10 Jul 2002 00:46:56 GMT
I have a simple page definition that looks like this:

--------------
<tiles:insert page="basicLayout.jsp">
 <tiles:put name="title" value="Music Index Home"/>
 <tiles:put name="header" value="header.jsp"/>
 <tiles:put name="footer" value="footer.jsp"/>
 <tiles:put name="sidebar" value="menu.jsp"/>
 <tiles:put name="body" value="mainBody.jsp"/>
</tiles:insert>
--------------

I'm thinking that it might be good to code "header.jsp" so it shows the "title"
string, by reference, instead of hard-coded, so I don't have to write it twice,
in two different places.  I would have to somehow "pass" the value provided for
the "title" attribute to "header.jsp" so it can read it as a request attribute,
possibly.

What are the various ways I could achieve this (hopefully without using
scriptlets)?  Is this a reasonable thing to do?

If I could send "request parameters" or "attributes" with "tiles:insert", then
with my "tiles:insert" tag for the "header" attribute, I could pass the output
of "tiles:getAsString" to get the "title" field.  I don't know if this is
possible, however.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net


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


Mime
View raw message