On 6/9/06, Henri Dupre <[EMAIL PROTECTED]> wrote:
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?

Yes.

and all the other urls served by static content?

Nope. When I meant static content (images, rss, etc.), I meant static
content served by Tapestry  too.

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

I have deployed the solution using UrlRewrite and the "HomeLink" component.
It works well as you can see on http://www.kalixia.com: I do have a
200 HTTP status on a request for '/'.

Now, I would prefer a solution without UrlRewrite.
The only thing I can think of is to write my own RedirectFilter which
would do a forward to '/' instead of a redirect.

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?

index.html is not a static page, but the result of rendering Tapestry
page 'index'.

If index.html was a tapestry page. Why don't you just make "index" as the
name of the home page?

I have probably missed something on this point. How can I configure
such a thing?
And remember that I want the content of my 'index' page to be served
to '/' and not '/index.html'.

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".

Which is something I want to avoid (I don't want a 302 or 301 HTTP
status on '/' but a real 200).

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.

Yep. That is the only other solution I can think of in order to remove
UrlRewrite.

My shortcut URL (http://wiki.apache.org/tapestry/ShortcutUrls) solution does
implement this.

This would make something similar to a RedirectFilter forwarding
instead of redirecting...


Regards,
Jérôme.


--
Jérôme BERNARD,
Kalixia, SARL.
http://weblog.kalixia.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to