Locale setting not working in JSF CarDemo
-----------------------------------------
Key: PORTLETBRIDGE-100
URL: https://issues.apache.org/jira/browse/PORTLETBRIDGE-100
Project: MyFaces Portlet Bridge
Issue Type: Bug
Components: Impl
Affects Versions: 2.0.0-alpha, 1.0.0-beta
Reporter: Michael Freedman
Assignee: Michael Freedman
The first page of the JSF sample CarDemo has you set the locale for the demo.
You choose a language/region and the rest of the views use strings earmarked
for the language of the locale. In the portlet case this fails -- you always
use the English/default locale. This is because the demo relies on an
ActionHandler to set the locale of the ViewRoot of the current view -- which
subsequently is migrated (by Faces) during the createView of the view the
action handler navigates to. When you render the subsequent view it uses this
locale. In the portlet case because render happens in a separate request -- we
rely on the bridge to cache the viewroot from the end of the action and preset
set it as the current viewRoot prior to running the lifecycle. Well Faces has
code in its restoreView phase that if the ViewRoot was preset then it resets
its locale to the preferred one from the current request. I.e. we lose the
locale we wanted (that was set when the view was created at the end of the
action). To fix this, cache the locale in the beforePhase (of restoreView) if
using the preset ViewRoot and restore it in the afterPhase.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.