tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Motley, Jeffery" <Jeffery.Mot...@Williams.com>
Subject tiles:putListAttribute question.
Date Tue, 03 Aug 2010 19:09:59 GMT


I have the following tiles-defs.xml definition.


<definition name="soa.master" template="/layouts/soalayout.jsp">


          <put-list-attribute name="jscripts" cascade="true">

                <add-attribute value="/soa/js/hello.js" />







I am using the following in my jsp file...


<tiles:insertDefinition name="soa.master">


<tiles:putListAttribute name="jscripts" cascade="true">

                <tiles:addAttribute value="/soa/js/hello2.js"





I am looping through the list to insert these js files into the head of
my page in another tile. 


<tiles:useAttribute id="jslist" name="jscripts"
classname="java.util.List" />

            <%   for(int i=0; i < jslist.size(); i++)  {


                        org.apache.tiles.Attribute jsfile =


            <script type="text/javascript" src="<%=jsfile%>"></script>

            <% } %>



When I do this the putListAttribute in the jsp file gets used but the
one on the xml file is not in the list. (It seems to be replaced.) So
only hello2.js is used. Is there any way to include hello.js from the
xml file and add the hello2.js from the jsp? That way both are included,
the generic hello.js  from the xml plus the more specific hello2.js for
the jsp.





  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message