facebook

multiple tiles-def.xml files with Struts

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #251269 Reply

    David
    Member

    Does 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.xml

    and 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.

    #251276 Reply

    Riyad Kalla
    Member

    Good 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.

    #251284 Reply

    Riyad Kalla
    Member

    Ahh scratch that, yes you can, your answer is here:
    http://mail-archives.apache.org/mod_mbox/struts-user/200406.mbox/%3CAE20D0C484360C4EB87FE1EE2C03938D28229D@MI8NYCMAIL05.Mi8.com%3E

    Example 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>
    
Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: multiple tiles-def.xml files with Struts

You must be logged in to post in the forum log in