2008/4/30 Neil Aggarwal <[EMAIL PROTECTED]>: > 2. Use a tiles controller to replace the header and footer > attributes on the definition containing the layout. > > So, my tiles.xml would have: > > <definition name="page.basic" template="/layout.jsp" > controllerClass="page.LayoutController"> > <put-attribute name="header" value="/header.jsp" /> > <put-attribute name="footer" value="/footer.jsp" /> > </definition> > > The LayoutController would check if the user came from > and affiliate and if they did, set the header and footer > attributes to the correct ones for the affiliate.
Notice that Tiles 2 changed the "controller" concept with the "view preparer", but essentially it works the same: http://tiles.apache.org/tutorial/advanced/preparer.html Anyway, if I was you, I would use your options 1 or 2 only if the pages are very limited in number. If they are too many, consider extending UrlDefinitionsFactory, to centralize the creation of definitions. For an example, see Dimensions: http://mutidimensions.sourceforge.net/ In fact, the Tiles 2 version is in the SVN trunk, and probably won't compile, but at least you will see how it works. HTH Antonio
