Rewrite conflict with HTTP request

Splash Forums Rewrite Users Rewrite conflict with HTTP request

This topic contains 3 replies, has 3 voices, and was last updated by  Lincoln Baxter III 6 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #26860


    Hi Folks,

    I’m coding a language selector for my application. I define the follow rule in my pretty configuration:

    <rewrite match="^/admin$" trailingSlash="append" toCase="lowercase" />
    <url-mapping id="admin">
    	<pattern value="/admin/" />
    	<view-id value="/pages/admin/dashboard/dashboard.xhtml" />

    The index method load the translation for my page, selected by the user. However I have a selector component that allow the user change the language:

    <h:panelGroup layout="block" id="selectCountry">
    <p:selectOneMenu id="countryLocale" widgetVar="countryLocale" value="#{language.localeCode}">
    <f:selectItems value="#{language.countriesInMap}" />
    <p:ajax event="change" listener="#{language.onChangeCountryLocaleCode}" />

    When I change the language the select component first request dashboardController.index and after request the language.onChangeCountryLocaleCode. I need to call language.onChangeCountryLocaleCode before dashboardController.index to update the language and the controller load the correct translation.

    Any suggestion?


    There are two ways to fix this.

    First you could simply redirect the user in onChangeCountryLocaleCode. This would result in a new request which would get the correct locale.

    The second option would be to configure PrettyFaces to execute the page action in a later JSF phase like RENDER_RESPONSE. See this part of the documentation for details:



    Thanks a lot!


    You are too fast, Christian! 🙂

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.