Re: SEO URL supporting l10n/i18n with PrettyFaces

Splash Forums PrettyFaces Users SEO URL supporting l10n/i18n with PrettyFaces Re: SEO URL supporting l10n/i18n with PrettyFaces

#23447

Your hint regarding the trailing slash solves two issues at once.

  1. Now it works exacty as I want it :-).
  2. There is no reason for complains, regarding violation of the schema, by the IDE anymore.

Now the code it looks like this:

<!-- welcome -->

<url-mapping id="welcome">

<pattern value="/"/>

<view-id value="/pages/index.xhtml"/>

</url-mapping>

<!-- lang -->

<url-mapping id="lang">

<pattern value="/#{languageSelected : localeHandler.languageSelected}" />

<view-id value="/pages/index.xhtml"/>

</url-mapping>

<!-- company -->

<url-mapping parentId="lang" id="company">

<pattern value="/company"/>

<view-id value="/pages/company.xhtml"/>

</url-mapping>

<h:link value="Home"

outcome="/pages/index">

<f:param name="languageSelected" value="#{localeHandler.languageSelected}"/>

</h:link>

<h:link value="Company"

outcome="/pages/company">

<f:param name="languageSelected" value="#{localeHandler.languageSelected}"/>

</h:link>

Examples of the resulting URL are:

http://localhost:8080

http://localhost:8080/en

http://localhost:8080/en/company

So far I equipped only some of the <h:link&#62 tags with the <f:param name="languageSelected" value="#{localeHandler.languageSelected}"/&#62 tag, for testing purpose. For sure, for all other’s, I will use auto-replace function of the IDE :-)

Regarding the URL mapping with PrettyFaces all works like I want it.

The next task for me will be to create a breadcrumb menu for this website, based on the method PrettyContext.getCurrentInstance().getRequestURL().

But now, so all work as I want it, in general, I ask myself, should I try the version using Rewrite as well?

Is there some more, regarding the URL mapping and creating a breadcrumb menu, that I could gain, against the effort to change my web app from using PrettyFaces to using Rewrite?