Hi Tim,
Scott's response pretty much covers the meat & potatoes. The leading "dot" naming convention is optional; some folks use it to clarify path confusion among Struts webapp files. I personally don't; the "dot" delimiter within the name does the job well enough for my usage.
HTH,
Curtis
Tim Christopher wrote:
<definition name="page.login" extends="base.definition"> <put name="title" value="Login Page" /> <put name="body" value="/jsp/loginBody.jsp" /> </definition>
I believe it is convention to place a leading . at the start of the definition's name. This signifies where the leading / would be if you used slashes. It'll work perfectly well without it though - just remember that if you change it you will need to update all of your paths in the struts config file too.
You may also find it useful to use 'org.apache.struts.actions.ForwardAction'. This action will automatically forward to the path / definition given as the parameter, ie. the code below loads the page associated to the definition of ..public.welcome in the tiles configuration file.
<action path="/welcome" type="org.apache.struts.actions.ForwardAction" parameter=".public.welcome"> </action>
Tim Christopher
On Tue, 22 Feb 2005 13:58:12 -0800, Scott Piker <[EMAIL PROTECTED]> wrote:
When using tiles this way, does this mean that any forward I define in my struts-config.xml should be a valid Tiles Definition?
Would that then imply that every page in my application is specified by a tiles Definition, and that's how I GET to any given page?
Yes, that's typically the way you would want to do it, but you're by no means forced to do it that way. Your struts-config can forward to a mixture of tiles-defs, JSPs, etc... but I prefer to keep everything tiles-centric.
example: I want to create a Profile Editing page, so I create profileEditBody.jsp and a NEW definition in the tiles-defs file specifying only the TITLE and BODY ..a la
<definition name="page.profile.edit" extends="base.definition"> <put name="title" value="Edit Profile Page" /> <put name="body" value="/jsp/profileEditBody.jsp" /> </definition>
Bue heres the question... how do I call this thing from an Action Class?!?!?! Argh!!!!
just refer to the definition name in the action mapping your struts-config:
<action path="/showProfileEdit" type=... > <forward name="success" path="page.profile.edit"/> </action>
HTH, - Scott
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]