There are a few other differences between direct and external links.
1) DirectLinks default to "stateful".  This means that if you had an
active HTTPSession when the link was created, and you click on the link
at a later time, after the session has expired, you'll get a "stale link
exception".
2) DirectLinks record "path" information in the url.  By path
information, I mean that directlinks record information about the
context in which they were rendered... what page was being rendered when
it was rendered, what page the direct link is in, if it is different
from the page that was being rendered (possible through
block/renderblock), etc.
External links do /not/ record this path information.  It only records
the name of the page and the parameters to be passed. Furthermore, it is
assumed that external links can always be hit "cold" (enough information
is recorded in the page parameters to correctly render the page, even if
no session currently exists for the user).

That said, you can force the direct link to be "stateless" by explicitly
setting the "stateful" parameter to false.
You still have all the path information, which can result is some really
ugly url's.  Also, since the path information is in place, these really
aren't suitable "bookmarkable" links; if you change your page or
component structure, rename, etc., you could wind up with issues.
So... generally, if you want a "bookmarkable" link, use external link.  :)

HTH.

Robert

Fernando Padilla wrote:
> I have lately been wondering, what's the real difference between
> DirectLink and ExternalLink.  It looks like I can boil it down to just
> what listener method they call.
> 
> - PageLink goes to a page, without using a listener method.
> - DirectLink goes to a user defined listener method.
> - ExternalLink goes to a predefined listener method (activateExternalPage).
> 
> So I can have DirectLinks work like ExternalLinks if they call the
> activateExternalPage listener method ( might have to change the
> signature to do this ofcourse ).
> 
> 
> 
> Does that summarize it all?
> 
> 
> Is there any more state magic that Tapestry is doing?
> 
> Any differences between 3x and 4x?
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to