Announcement Announcement Module
Collapse
No announcement yet.
How to change locale, i18n, jsf? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to change locale, i18n, jsf?

    I've got a big problem. In my application (spring 2.5.6, swf 2.0.8, security 2.0.4, jsf 1.1 (WAS 6.1) and facelets) I have to add i18n support (PL(default), EN and GE). In my template I have 3 links (PL, EN, GE). I try to use LocaleChangeInterceptor, but it is not work correctly. How can I change language on the site?

    My code:
    Code:
    <bean>
        <property name="flowRegistry" ref="flowRegistry" />
        <property name="defaultHandler">
             <bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController" />
        </property>		
    </bean>
    
    <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
        <property name="flowExecutor" ref="flowExecutor" />
    </bean>
    
    <bean id="faceletsViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
         <property name="viewClass" value="org.springframework.faces.mvc.JsfView"/>
         <property name="prefix" value="/WEB-INF/xhtml/" />
         <property name="suffix" value=".xhtml" />
    </bean>

    webflow config:
    Code:
    <webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry" >
         <webflow:flow-execution-listeners>
              <webflow:listener ref="securityFlowExecutionListener" />
         </webflow:flow-execution-listeners>
    </webflow:flow-executor>
    	
    <webflow:flow-registry id="flowRegistry" base-path="/WEB-INF/flows" flow-builder-services="facesFlowBuilderServices" >
    	<webflow:flow-location-pattern value="/**/*-flow.xml" />
    </webflow:flow-registry>
    
    <bean id="securityFlowExecutionListener" class="org.springframework.webflow.security.SecurityFlowExecutionListener"/>
    
    <!-- Configures the Spring Web Flow JSF integration -->
    <faces:flow-builder-services id="facesFlowBuilderServices" development="true"/>


    faces-config:
    Code:
    <application> 
          <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>  
          <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
          <message-bundle>com.myApp.messages.messages</message-bundle>
          	<locale-config>
          	 	<default-locale>pl</default-locale>
          	 	<supported-locale>en</supported-locale>
    		<supported-locale>de</supported-locale>
          	 </locale-config>	
    </application>
Working...
X