Re: Best Practices for PrettyFaces and Multiple language sites

Splash Forums PrettyFaces Users Best Practices for PrettyFaces and Multiple language sites Re: Best Practices for PrettyFaces and Multiple language sites

#20690

icordoba
Participant

Hello Lincoln. Thanks for your reply. Just tested and it works ok. I have solved my home page problem. Let me ask for help in another question.

In english version of the home page I want to link to english articles, which should be accessed /en/article/my+article+title URI so I’ve tried:

<url-mapping id="enViewCMArticle" parentId="enHome" >

<pattern value="/article/#{articleTitle}" />

<view-id>/contentmanager/article.jsf</view-id>

</url-mapping>

This works ok inheriting from the enHome /en mapping if I write the URL in the browser (http://mysite.com/en/article/My+Article) or if I reference it from a direct a href tag but I have a problem referencing this pretty URL from a h:link tag:

As I want to use the same xhtml/jsf file: /contentmanager/article.jsf I’ve included in faces-config.xml:

<navigation-rule>

<navigation-case>

<from-outcome>/en/contentmanager/article</from-outcome>

<to-view-id>/contentmanager/article.xhtml</to-view-id>

</navigation-case>

</navigation-rule>

then I try

<h:link outcome=”/en/contentmanager/article” value=”#{msgs.more}…”><f:param name=”articleTitle” value=”My Title”/></h:link>`

This should create /en/contentmanager/article outcome as it is referenced in the <h:link> tag, but pretty faces makes h:link render the link to /article/My+Title and not /en/article/My+Title; it fallbacks to the simpler:

<url-mapping id="viewCMArticle">

<pattern value="/article/#{articleTitle}" />

<view-id>/contentmanager/article.jsf</view-id>

</url-mapping>

pretty mapping and ignores the /en/ mapping

Any ideas?

Thanks again,

Ignacio