Spring Framework LocaleChangeInterceptor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework LocaleChangeInterceptor class.

This code example shows how to use the following methods:setParamName
	 * property which sets the request parameter to check for changing the language, the default is <code>locale</code>. 
	 * @return the {@link LocaleChangeInterceptor} 
	 */ 
	@Bean 
	public LocaleChangeInterceptor localeChangeInterceptor() {
		LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor();
		localeChangeInterceptor.setParamName("lang");
		return localeChangeInterceptor;
	} 
 
	/** 
	 * The {@link LocaleResolver} implementation to use. Specifies where to store the current selectd locale. 
	 *  
	 * @return the {@link LocaleResolver} 
	 */ 
	@Bean 
	public LocaleResolver localeResolver() {
		return new CookieLocaleResolver();
	} 
 
5
CodeRank
This code example shows how to use the following methods:setParamName
        return localValidatorFactoryBean; 
    } 
 
    @Override 
    protected void addInterceptors(InterceptorRegistry registry) { 
        LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); 
        localeChangeInterceptor.setParamName("language"); 
        registry.addInterceptor(localeChangeInterceptor); 
    } 
 
    @Bean 
    public MessageSource messageSource() { 
        ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); 
        messageSource.setBasenames("classpath:messsages", "classpath:org/hibernate/validator/ValidationMessages"); 
        messageSource.setUseCodeAsDefaultMessage(false); 
        messageSource.setDefaultEncoding(env.getProperty("encoding")); 
        messageSource.setCacheSeconds(60); 
        return messageSource; 
    } 
 
4
CodeRank
This code example shows how to use the following methods:setParamName
This code example shows how to use the following methods:setParamName
See Code Examples for Spring Framework LocaleChangeInterceptor Methods: