- This topic has 2 replies, 2 voices, and was last updated 19 years ago by
Riyad Kalla.
-
AuthorPosts
-
DavidMemberDoes anyone know if it is possible to have several tiles definition files used with Struts? I am anticipating many, many JSP’s and rather than have one huge tiles-def.xml file, can I have one for each area (i.e. general/admin/product/etc)? I looked at just creating several names like:
admin-tiles-def.xml
general-tiles-def.xmland then in my struts-config.xml file something like this:
<plug-in className=”org.apache.struts.tiles.TilesPlugin”>
<set-property property=”definitions-config”
value=”/WEB-INF/admin-tiles-defs.xml” />
<set-property property=”moduleAware” value=”true” />
</plug-in><plug-in className=”org.apache.struts.tiles.TilesPlugin”>
<set-property property=”definitions-config”
value=”/WEB-INF/general-tiles-defs.xml” />
<set-property property=”moduleAware” value=”true” />
</plug-in>But this doesn’t quite right. Thank you for any advice you can offer.
Riyad KallaMemberGood question, I have no idea. Have you tried it? Also with Struts you name modules as a comma separated list in the web.xml, I wonder if you can do the same with a single tiles plugin entry and a comma separated list of tiles-def files… you might asking on the struts list as well, they can probably get you a definitive answer right away.
Riyad KallaMemberAhh scratch that, yes you can, your answer is here:
http://mail-archives.apache.org/mod_mbox/struts-user/200406.mbox/%3CAE20D0C484360C4EB87FE1EE2C03938D28229D@MI8NYCMAIL05.Mi8.com%3EExample here:
<!-- TILES PLUGIN --> <plug-in className="org.apache.struts.tiles.TilesPlugin"> <set-property property="definitions-config" value="/WEB-INF/struts/main-tiles-defs.xml, /WEB-INF/struts/module1/MODULE1-tiles-defs.xml, /WEB-INF/struts/module2/MODULE2-tiles-defs.xml, /WEB-INF/struts/module3/MODULE3-tiles-defs.xml, /WEB-INF/struts/module4/MODULE4-tiles-defs.xml" /> <set-property property="definitions-debug" value="2"/> <set-property property="definitions-parser-details" value="2"/> <set-property property="definitions-parser-validate" value="true"/> </plug-in>
-
AuthorPosts