Announcement Announcement Module
No announcement yet.
LocaleChangeInterceptor not working Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • LocaleChangeInterceptor not working

    Hi All,
    I tried for a long time in getting the internationalization to work , but in vain. I have read through all the forums, but still I couldn't get this to work. I use Spring Spring Webflow in my application for UI Rendering.

    I have and Text from are always rendered. When I pass URL parameters with zh, nothing is happening and page loads with English language again. Any help is really appreciated. I have used interceptors and handlers as suggested, but still nothing happens. Spring version is 3.0.3 and webflow version is 2.1.1.

    Please find below the details of my code.

    The Web-mvc config file which is included in Spring configuration file is
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns=""
    xmlns:xsi="" xmlns:webflow=""

    <!-- Executes flows: the central entry point into the Spring Web Flow system -->
    <webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry"/>

    <!-- The registry of executable flow definitions -->
    <webflow:flow-registry id="flowRegistry"
    flow-builder-services="flowBuilderServices" base-path="/WEB-INF">
    <webflow:flow-location-pattern value="/**/*-flow.xml" />
    <!--<webflow:flow-location path="user/register-flow.xml" />-->

    <!-- Plugs in a custom creator for Web Flow views -->
    <webflow:flow-builder-services id="flowBuilderServices"
    view-factory-creator="mvcViewFactoryCreator" />

    <!-- ResourceBundle entries -->


    <bean id="messageSource"
    class=" bleResourceBundleMessageSource">
    <property name="basename" value="classpath:label" />
    <property name="defaultEncoding" value="UTF-8"/>

    <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.Locale ChangeInterceptor">
    <property name="paramName" value="lang" />

    <bean id="localeResolver"
    class="org.springframework.web.servlet.i18n.Cookie LocaleResolver">
    <property name="defaultLocale" value="en" />

    <bean class="org.springframework.webflow.mvc.servlet.Flo wHandlerMapping">
    <property name="flowRegistry" ref="flowRegistry" />
    <property name="defaultHandler">
    <!-- If no flow match, map path to a view to render; e.g. the "/intro" path would map to the view named "intro" -->
    <bean class="org.springframework.web.servlet.mvc.UrlFile nameViewController" />
    <property name="interceptors">
    <ref bean="localeChangeInterceptor" />

    <bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="interceptors">
    <ref bean="localeChangeInterceptor"/>

    <bean class="org.springframework.web.servlet.i18n.Locale ChangeInterceptor" >
    <property name="paramName" value="lang" />

    <!-- Configures Web Flow to use Tiles to create views for rendering; Tiles
    allows for applying consistent layouts to your views -->
    <bean id="mvcViewFactoryCreator"
    class="org.springframework.webflow.mvc.builder.Mvc ViewFactoryCreator">
    <property name="viewResolvers" ref="tilesViewResolver" />
    <property name="useSpringBeanBinding" value="true" />


    Invoking parameters, using the below jsp.
    <span style="float: right">
    <a href="?lang=en">en</a>
    <a href="?lang=zh">zh</a>

  • #2
    Hi Team,

    Can anyone help on this please ?