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 '/'. 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.). 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> This is quite ugly, but I can't figure out if there is a better solution to this problem. The problem is that it seems there is no way to map the servlet to '/', and '/' only (no recursivity). [Sounds like I'm complaining as Howard do in his blog at http://howardlewisship.com/blog/2004/12/servlet-mapping-limitations.html] I guess there is no way to setup Tapestry using a servlet filter instead of a servlet? The only option could be to use Resin instead of Tomcat. Resin provides servlet-mappings using regexp... Regards, Jérôme. On 6/7/06, Henri Dupre <[EMAIL PROTECTED]> wrote:
Hi Jerome, I'm not sure to understand the whole problem... For serving / instead of index.html that sounds to me more connected to
your
apache configuration. Unless this is part of your tapestry/tomcat application. Then for generating "/" links, there are many possibilities around... it depends what kind of links do you want to generate "/". You could either just implement an AbstractLink component and supply your own ILink implementation. Or if you want "/" for the home service for instance, I would rather implement a ServiceEncoder. I wrote several things like that for our website... I can send you some
code
for either one... Nice to see other tapestry websites in France! On 6/7/06, Jérôme BERNARD <[EMAIL PROTECTED]> wrote: > > Hi, > > I am trying to make my website (http://www.kalixia.com) working fine > for SEM (Search Engine Marketing). My current setup is an Apache > front-end talking to a Tomcat server (using mod_jk). > > What I would like to be able to do is to have my home page > (index.html) served by a request to '/' instead of '/index.html' (and > of course to have links generated to '/' instead of '/index.html'). I > can't figure out how to do it... > > Do I have to write my own kind of link component and link to the home > of the website using this custom link component? > > If it is not possible to do such a thing, how could I setup my website > so that I can avoid an HTTP 301 error (permanent redirection) to > '/index.html' when the visitor is requesting the content of '/'? > > > 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] > > -- Thanks, Henri. www.actualis.com
-- Jérôme BERNARD, Kalixia, SARL. http://weblog.kalixia.com