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

#20688

icordoba
Participant

Thanks for your reply Christian,

I’m trying to set it up first for the homepage:

URI http://www.mysite.com/ should show the spanish version

http://www.mysite.com/en should show the same index.jsf but first invoke #{userSessionView.language} named bean property.

<url-mapping id="enHome"> <!--parentId="home" -->

<pattern value="/#{ /en/ language }" />

<query-param name="language">#{userSessionView.language}</query-param>

<view-id>/index.jsf</view-id>

</url-mapping>

The /en/ pattern is recognized and the page shows ok. Shouldn’t this value be transfered as a request parameter “language” with previous code? (Probably I misunderstood the pattern tag doc.

If I invoke the URL

http://www.mysite.com/en?language=en

the setter is invoked and english locale is shown.

My problem is the just make prettyfaces recognize the /en constant and pass it to the bean via setLanguage.

Thanks for any ideas,

Ignacio