On 6/9/06, Jérôme BERNARD <[EMAIL PROTECTED]> wrote:

The only solution I have found so far to work is to:
- use a HomeLink component :
public abstract class HomeLink extends AbstractLinkComponent {
   @InjectObject("service:tapestry.globals.WebRequest")
   public abstract WebRequest getRequest();
   public ILink getLink(IRequestCycle cycle) {
       return new StaticLink(getRequest().getContextPath());
   }
}
- use this HomeLink component in my Border component (instead of a
previous
PageLink)

So far, this means that I'll be able to have my links generated to '/'.


That's the kind of solution I had in mind.

Now in order to serve the 'index' page to '/', I can't use a servlet mapping
of the tapestry servlet to '/' (otherwise, I won't be able anymore to
serve
static resources like images, css, etc.).


I don't get this one... You want "/" to be served by tapestry? and all the
other urls served by static content?
Can you put all your static content in your war file? Then it will work.
Also you can configure Jk to ignore certains paths and let apache serve
them


The only solution I found is to
use UrlRewrite (http://tuckey.org/urlrewrite/) with the following rule
(this
is a forward rule and not a redirect one, so no problem with SEO):
<rule>
       <from>^/$</from>
       <to>/index.html</to>
</rule>


Again I'm confused... The index.html, is it living in the tapestry/tomcat
world or the apache world?
If index.html was a tapestry page. Why don't you just make "index" as the
name of the home page?
There are some parameters in tapestry for that.
Then if you setup friendly urls and set "html" as extension for the
page-service, then / will redirect to "index.html".
This seems to be the default behavior of the tapestry redirect filter but it
is very easy to rewrite it and forward the request from "/" to "index.html"
instead of sending a redirect.
My shortcut URL (http://wiki.apache.org/tapestry/ShortcutUrls) solution does
implement this.

Thanks,

Henri.

Reply via email to