Hi Sean,

  In the actual Tiles implementation, you can't access directly a jsp page
intended to be used by a definition, or inserted by a <insert> tag. If you do so
(access it directly from your web browser) you will got errors, because Tiles
context will not be set.
  To access a Tile page, you have to do it with <insert>, or by forwarding to it
after an action.

  This is why the <link> tag doesn't work as you expect.
  A possible trick is to have an action forwarding to the definition. This
action do nothing except forward. Then, you can use action name or url to refer
the definition.

  As such functionality is required by lot of user, I will try to find a
solution. For now, I see three possible ways :

   * Register automatically a Struts action for each definition name
        o drawback : definition names have to comply with action name.
          Implementation issues ?
        o advantage : will reduce amount of line in struts-config.xml
   * Have a tag at the beginning of each jsp/tile which set tile context if not
     already set.
        o drawback : need to put the tag in each jsp/tile
        o advantage : really easy to implement
   * Extends Struts action/forward mechanism to check if action name is a
     definition name. In this case, insert definition.
        o drawbacks : not easy to implement. Definition names must met action
          name requirement.
        o advantages : no new tag
   * Use new servlet/jsp interceptors (don't remind the exact name)
        o drawback : can only be used with containers implementing last
          servlet/jsp spec.
        o advantage : no tag, no modification in Struts

  In addition to all this possibilities, we need to modify <link> tag to allow
mapping from a definition name to its URL. This is not very difficult to do, but
imply that Struts is aware of Tiles. For now, we try to keep both separated.

  If someone have other ideas, let me know !

     Cedric



Sean wrote:

> I was wondering if anyone had a patch to the nightlies or the current Tiles
> release that fixes the struts html:link forward tag to look in the tiles
> component definition mappings like the forward does from actions.  Right now
> it just puts in the value of the forward instead of doing a lookup so I have
> to do some hacks to get it to work.  It would make life a lot easier with
> this ... Anyhow, any help would be appreciated.  I may just fix it myself
> but I don't want to if I don't have to... I will submit it to the list if I
> do need to fix it.
>
> Sean
>
> P.S. What is the word on Tiles being standard and pulled into Struts 1.1?
> Is is always going to be contrib or will it be a pure bred soon ;) ?

Reply via email to