Seam 2.2.0 URL Rewriting Doesn't Work

I am trying a simple example of rewriting a URL, but it does not work for me. I am using Seam 2.2.0 for JBoss 5.1.0.

My .xml pages contain:

 <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 .xml components contain:

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

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

+3
source share
3 answers

, Tuckey Rewrite Seam. , page.xml I, main pages.xml. , , .

0

:

" , Faces web.xml. , *.seam."

0

I do not know why you come up, does not work. But do not forget that you can use the file viewName.page.xmlfor the same purpose.
For example, since the name of your page index.xhtml, you must create the file index.page.xmlin the same folder that contains the file index.xhtml(in your case, inside the folder html).

In the file, index.page.xmladd this.

<rewrite pattern="/home" />

As you already do, your file component.xmlshould contain a line

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

Deploy again and it should work.

0
source

Source: https://habr.com/ru/post/1717962/


All Articles