Flip it and revrse it, go to tiles, that call actions:
<definition name="myPage1" extends="baseLayout">
<put name="body" value="/do/myPage1"/>
<put name="tile" value="/do/myTile"/>
/>
<definition name="myPage2" extends="baseLayout">
<put name="body" value="/do/myPage2"/>
<put name="tile" value="/do/myTile"/>
/>
And then yor Struts mapping forwards are <forward name="Success" path ="/WEB-INF/jsp/myPage1.jsp" ...
<forward name="Success" path ="/WEB-INF/jsp/myPage2.jsp"
You can (should?) have a /do in a tile, for action to figure out what JSP to assemble. Also explained in Tiles 201.
.V
Brice Ruth wrote:
I have an Action that will do some DB things and currently return a pre-defined ActionForward that links to a pre-defined Tile definition. Examples are below. What I want to do, is save myself some typing, and assemble the tile definition dynamically in the Action, and then return a new ActionForward for that definition (or something like this). The reason being, the forwards & Tile definitions (currently) would need to be duplicated 4 additional times to support the different sections of our site.
Any suggestions? I'd need to be able to create definitions that extend pre-defined ones (like .baseLayout.garden) as well as setting attributes that reference pre-defined definitions (like .mainLayout). Thanks in advance!
Forwards: <forward name="displayProduct" path="garden.product"/> <forward name="showCategory" path="garden.category"/>
Tile-Defs:
<definition name="garden.product" extends=".baseLayout.garden">
<put name="mainLayout" value=".mainLayout"/>
<put name="navigation" value=".navigation.level3"/>
<put name="content" value="/common/tiles/productContent.jsp"/>
</definition>
<definition name="garden.category" extends=".baseLayout.garden">
<put name="mainLayout" value=".mainLayout"/>
<put name="navigation" value=".navigation.level3"/>
<put name="content" value="/common/tiles/productCategoryContent.jsp"/>
</definition>
-- Victor Cekvenich, Struts Instructor (215) 321-9146
Advanced Struts Training <http://basebeans.com/do/cmsPg?content=TRAINING> Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, <http://basicportal.com> software, ready to develop/customize; requires a db to run.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

