How to specify rewrite pattern in pages.xml

I have many xhtml files in several folders. I want to rewrite the URL as

from http: // localhost: 8080 / folder1 / file1.seam to http: // localhost: 8080 / folder1 / file1

In file1.page.xml I gave

<rewrite pattern="/folder1/file1" />

The above provided me with the correct template. But I have many files, and I do not want to specify this rewrite pattern in every page.xml file. Is there a way to specify this in pages.xml?

EDIT:

http://localhost:8080/folder2/file2.seam to http://localhost:8080/folder2/file2
http://localhost:8080/folder3/file3.seam to http://localhost:8080/folder3/file3

More samples of my translation

+5
source share
2 answers
  • The rewriting is based on the rewriting of the templates found for views in pages.xml

  • URL rewriting makes seam and outgoing rewriting URLs based on the same pattern

Example:

<page view-id="/home.xhtml">
  <rewrite pattern="/home" />
</page>
  • /home /home.xhtml
  • , /home.seam, /home
  • URL-

    • /home.seam?conversationId=13
    • /home.seam?color=red

<page view-id="/home.xhtml">
  <rewrite pattern="/home/{color}" />
  <rewrite pattern="/home" />
</page>

/home/red , /home.seam?color=red

, URLr /home.seam?color=blue /home/blue

:

, :

<page view-id="/search.xhtml">
  <rewrite pattern="/search-{conversationId}" />
  <rewrite pattern="/search" />
</page>

/search.seam?conversationId=16 /search-16

,

<page login-required="true" view-id="/admin/*">

,

.

, URL-. , . , , .: -)

+8

, . .

+2

All Articles