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

#23446

The mapping “lang” becomes highlighted by the IDE (IntelliJ IDEA) and a error message becomes shown as follows:

“The content of element “url-mapping” is not complete. One of ‘{“http://ocpsoft.com/prettyfaces/3.3.3”:query-param, “http://ocpsoft.vom/prettyfaces/3.3.3″:view-id}” is expected.”

Seems like the XSD file for pretty-config.xml is not correct here. Thanks for pointing that out. You can ignore this. It is not a real problem. But you could also add a view-id element with some value. This will be OK because it will be overwritten by the parenting mechanism AFAIK.

It’s a lot of work to equip each h:link with <f:param name=”languageSelected” value=”#{localeHandler.languageSelected}”/>

However, if it works it would be worth to do the effort.

Yeah, that’s true. Perhaps you could try some clever global search-and-replace operation to add this. Something like replace all:

</h:link>

with:

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

:)

Regarding the trailing slash on the welcome page. You could add a view id to the base mapping. Then the base mapping will also be your welcome page. Something like this:

<url-mapping id="lang">
<pattern value="/#{languageSelected : localeHandler.languageSelected}" />
<view-id value="/pages/index.xhtml"/>
</url-mapping>

But I’m not 100% sure if this will work. You will have to give it a try.