If you have also file "index.page.xml" or "linker.page.xhtml" in your project you need to put above as well. So fx for index.page.xml:
<rewrite pattern="/home" />
Greg Charles wrote on Sep 22, 2009 06:12:
My components.xml contains:
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 http://mysite/link?param=something, I just get a 404 page. What am I missing?
I think your rewrite-filter is not correct configured. Because your view-ids ends with .xhtml and you set .seam. See also documentation at
18.104.22.168. URL rewriting
Thanks for the replies!
@Majkel No, my project uses pages.xml exclusively for configuring the pages. There are no xxx.page.xml files.
@Frank Really? It's pretty much standard practice to write a page as pagename.xhtml and then access it via pagename.seam, thanks to the Faces Servlet servlet mapping in web.xml. Section 22.214.171.124, which of course I have seen already, says that the
view-mapping parameter must match the servlet mapping defined for the Faces Servlet in the web.xml file.Which it does. Just for s and g, I've also tried
/*. All fail equally silently.
My main frustration comes from the lack of diagnostic information. There are no error messages, or any other indication of where Seam is failing, or even if it's trying at all. How can I get it to give me something to work with?
You're right with configuration issue I posted.
The only hint I have for you is to look if the RewriteFilter is really initalized and called, and if, so debug the filter.
Try moving <web:rewrite-filter view-mapping="*.seam"/> up in your components.xml. I placed it just after <core:init .../> Had some problems when it was at end of the document as well.
Thanks guys! Moving the rewrite-filter up helped, but my main problem was one you couldn't possibly have guessed. Our Maven build is doing an overlay, and I didn't realize my component.xml was being overlaid with a different component.xml, which didn't have the rewrite-filter. Now everything is working perfectly ... except that I'm a bit embarrassed. Thanks anyway for all your help.