My problem is: I have 10 (or more ) css files, some pages use 2 of those, some of those uses 5 of those, some pages use 6 of those, and this combination is totally random. Then we I create tiles template, I can't put all these css in the template, instead I thought I can do the following:
My template: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title><tiles:getAsString name="title" ignore="true"/></title> <style type="text/css" media="screen"> <tiles:getAsString name="myCss1" ignore="true"/> <tiles:getAsString name="myCss2" ignore="true"/> <tiles:getAsString name="myCss3" ignore="true"/> <tiles:getAsString name="myCss4" ignore="true"/> <tiles:getAsString name="myCss5" ignore="true"/> <tiles:getAsString name="myCss6" ignore="true"/> <tiles:getAsString name="myCss7" ignore="true"/> <tiles:getAsString name="myCss8" ignore="true"/> <tiles:getAsString name="myCss9" ignore="true"/> <tiles:getAsString name="myCss10" ignore="true"/> </style> </head> <body> <tiles:insert attribute="header"/><br /> <tiles:insert attribute="bodyContent"/><br /> <tiles:insert attribute="footer"/><br /> </body> </html> Then I need to define myCss1 and etc in the tiles-def.xml, I don't know what is the good one to define this, I don't want to define them like the following : <definition name="default" path="/jsp/common/main.jsp"> <put name="header" value="/jsp/common/header.jsp" /> <put name="footer" value="/jsp/common/footer.jsp" /> </definition> <definition name="mySepeficPage" extends="default"> <put name="title" value="SMERF > Change Request Queue" /> put name="myCss1" value="the path to the Css1" <put name="bodyContent" value="/jsp/mySpefic.jsp" /> </definition> Since that will make my tiles-def.xml too massy. So the original issue is how to put the dynamic css files in the template between <head>....<head>. I would think this is a common issue for tiles community. Do you have any better way to resolve this issue? -----Original Message----- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: Monday, November 12, 2007 10:30 AM To: Struts Users Mailing List Subject: Re: Tiles-def.xml 2007/11/12, Zhang, Larry (L.) <[EMAIL PROTECTED]>: > > Can I define a constant in tiles-def.xml so that I can used it in all > places inside this file? No, but probably you can do it in another way. What do you want to do exactly? Antonio P.S.: If you are using Tiles 2, please ask this question to Tiles Users Mailing List: http://tiles.apache.org/mail.html If you are using Struts/Tiles, go on here and ignore this P.S. :-) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]