views:

684

answers:

1

I'm trying a simple example of URL rewriting, but it's not working for me. I'm using Seam 2.2.0 deployed to JBoss 5.1.0.

My pages.xml contains:

 <page view-id="/html/index.xhtml">
    <rewrite pattern="/home" />
</page>

and

<page view-id="/html/common/redirect.xhtml" action="#{redirectAction.redirect}">
    <rewrite pattern="/link" />
    ...

My components.xml contains:

    <web:rewrite-filter view-mapping="*.seam"/>

As far as I can tell from the documentation, that should be all I need. However, none of the internal links appear different, and if enter the URL: http://mysite/home or mysite/link?param=something, I just get a 404 page. What am I missing?

A: 

I had the same problem when I tried to move from the Tuckey Rewrite Filter to Seam. After some trial and error I finally noticed that I had a page.xml for the view I but added the pattern in the main pages.xml. The former seems to overwrite the latter.

Elmar Weber