@Override public void addInterceptors(InterceptorRegistry registry) { super.addInterceptors(registry); }
@Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(interceptor).addPathPatterns("/**").excludePathPatterns("/error**"); super.addInterceptors(registry); }
/** * Adds a <code>LocaleChangeInterceptor</code>. It changes the locale when requested.<br> * On each request to the <code>DispatcherServlet</code>, it looks for a request parameter, which * defaults to <code>locale</code> but can be customized. If this request parameter exists, the * interceptor converts the <code>String</code> parameter to a <code>Locale</code> and then uses * the <code>LocaleResolver</code>’s <code>setLocale</code> method to set the locale.<br> * <br> * On any page you can add a link to change locales and simply submit it to the current page. This * not only changes the locale for the current page, it also changes the locale for all subsequent * pages the user visits until his session times out or he closes his browser. <br> * Example usage: <code>http://localhost:8080/i18n/<strong>?locale=es_MX</strong></code><br> */ @Override public void addInterceptors(InterceptorRegistry registry) { super.addInterceptors(registry); registry.addInterceptor(new LocaleChangeInterceptor()); }