If anchor links is the *only* problem with using a different <base> (i
don't know), i'ts probably better if people who need them are forced to
use a certain component:
<a href="#top" t:type t:type="AnchorLink">Top</a>
In your example, Tapestry would then render that as:
<a href="http://localhost:9999/d1/UsingBase.html/foo/foo#top">Top</a>
and the link would make the browser scroll instead of sending a new
request.
Martin
On Sun, 07 Jan 2007 14:45:26 +0100, Kent Tong <[EMAIL PROTECTED]> wrote:
Martin Strand <do.not.eat.yellow.snow <at> gmail.com> writes:
Using a <base> different than the current url messes up simple anchor
links. I.e. this would result in a new request rather than just
scrolling:
<a href="#top">Top</a>
I'm sure this doesn't bother everyone but I have lots of those links and
that's the reason I don't use <base>
I see. Then I guess we'd need something that is easier to use than Image:
<img src="../images/foo.gif" t:type="TemplateRelativeResource"/>
Such a TemplateRelativeResource is like the Any component, it will just
output the element it is associated with. But it won't evaluate the
attributes. Instead, it will try to convert a particular attribute
("src" here) of the element from a relative path to an absolute URL,
assuming that it is relative to the page template. It should work no
matter the template is in the context root or on the classpath.
It should have some built-in knowledge:
For <img>, convert the "src" attribute.
For <link>, convert the "href" attribute.
For <a>, convert the "href" attribute.
...
For unforeseen cases, it should take an "attribute" parameter.
There may be an annotation in the page class to indicate that Tapestry
should treat all <img> elements in the page as TemplateRelativeResource.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]