ICEfaces
  1. ICEfaces
  2. ICE-2485

Set Ajax request header Accept-Language from previous lifecycle's Locale

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7DR#2
    • Fix Version/s: 1.7DR#3
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      All, but specifically needed for ICEfaces + JSP + JSF 1.2
    • Assignee Priority:
      P2

      Description

      This is probably the simplest solution for ICE-1505, and may be required for ICE-2419.

      When sending the page to the browser, it would be nice if we could take the locale id in UIViewRoot.getLocale(), and make that available to the bridge Javascript, so that it could make that locale id be the first entry in the Accept-Language request header. This is necessary because when components render their output in a certain locale in one lifecycle, the validation phase in the subsequent lifecycle must use the same locale, so that dates, numbers, currencies, etc. will be parsable and validatable. It also would keep the locale sticky, for when developers programmatically set the locale, and expect it to remain until they set it to a different value.

      As it stands, without this change, some JSF RI code in com.sun.faces.lifecycle.RestoreViewPhase.execute(FacesContext) can stomp over the correct locale, with whatever happens to be the first one listed in the Accept-Language request header.

        Issue Links

          Activity

          Mark Collette created issue -
          Ken Fyten made changes -
          Field Original Value New Value
          Link This issue blocks ICE-2419 [ ICE-2419 ]
          Ken Fyten made changes -
          Link This issue blocks ICE-1505 [ ICE-1505 ]
          Ken Fyten made changes -
          Fix Version/s 1.7DR#3 [ 10112 ]
          Assignee Mircea Toma [ mircea.toma ]
          Ken Fyten made changes -
          Assignee Priority P2
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #15360 Wed Dec 12 17:21:31 MST 2007 mircea.toma Calculate locale on each request.
          ICE-2485
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletExternalContext.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletEnvironmentRenderRequest.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/env/CommonEnvironmentRequest.java
          Commit graph MODIFY /icefaces/trunk/icefaces/samples/component-showcase/web/WEB-INF/faces-config.xml
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/application/D2DViewHandler.java
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDate.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletEnvironmentRequest.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletExternalContext.java
          Hide
          Mircea Toma added a comment -

          Instead of passing back and forth the locale I fixed the issue by selecting the locale on every request. The locale selection is based on the accepted locales of the browser and server's supported locales. Calls to UIViewRoot.setLocale() will now memoize the locale selection.
          Now it is possible to change browser's language preferences and the rendered content will reflect them immediately.

          Show
          Mircea Toma added a comment - Instead of passing back and forth the locale I fixed the issue by selecting the locale on every request. The locale selection is based on the accepted locales of the browser and server's supported locales. Calls to UIViewRoot.setLocale() will now memoize the locale selection. Now it is possible to change browser's language preferences and the rendered content will reflect them immediately.
          Mircea Toma made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #15373 Fri Dec 14 14:06:04 MST 2007 mircea.toma Ignore locale set by RestoreViewPhase class.
          ICE-2485
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/application/D2DViewHandler.java
          Hide
          Mircea Toma added a comment -

          Ignore locale set by RestoreViewPhase class.

          Show
          Mircea Toma added a comment - Ignore locale set by RestoreViewPhase class.
          Hide
          Mark Collette added a comment -

          Tweaked the algorithm for this in ICE-1505, to help meet ICE-2419 requirements.

          Show
          Mark Collette added a comment - Tweaked the algorithm for this in ICE-1505 , to help meet ICE-2419 requirements.
          Ken Fyten made changes -
          Issue Type New Feature [ 2 ] Improvement [ 4 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #15517 Tue Jan 08 15:35:17 MST 2008 mircea.toma ICE-2485
          Insert page references directly into the document.
          Refactor.
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/DOMResponseWriter.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/NormalModeSerializer.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/BridgeFacesContext.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #15523 Wed Jan 09 16:01:11 MST 2008 mircea.toma Insert references at the beginning of portlet content.
          ICE-2485
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/DOMResponseWriter.java
          Hide
          Sam Xiao added a comment -

          ICE-2419 failed on regression. Locale change reverts after interact with the page

          Show
          Sam Xiao added a comment - ICE-2419 failed on regression. Locale change reverts after interact with the page
          Sam Xiao made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          Sam Xiao added a comment -

          false alarm.

          Show
          Sam Xiao added a comment - false alarm.
          Sam Xiao made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]

            People

            • Assignee:
              Mircea Toma
              Reporter:
              Mark Collette
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: