From the course: Spring: Spring MVC
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
CookieLocaleResolver and interceptor for l10n and i18n
From the course: Spring: Spring MVC
CookieLocaleResolver and interceptor for l10n and i18n
- [Tutor] If you do not want to do automatic locale resolution you can also do it with interceptors. When it comes to locale resolvers in Spring MVC there are many implementations. A cookie locale resolver, a session locale resolver, a fixed locale resolver, et cetera, so when you talk about session locale resolver it'll use a locale attribute in the user's HTTP session for a custom setting. In case of a cookie locale resolver it is going to use a cookie which will send back to the user in case of the custom setting. So in this demo we are going to use a cookie locale resolver coupled with the locale change interceptor, which will help us to pass that query param. So the first step is to add the cookie locale resolver into our application, so let's go back to the IDE and grab our application config, and inside that let's register the bean for the cookie locale resolver. So I'm going to say public, locale resolver, and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
Introduction to interceptors3m 28s
-
Built-in and custom interceptors2m 45s
-
Add interceptor class5m 45s
-
Register interceptors3m 17s
-
Request and session attributes1m 57s
-
Save and get SessionAttributes demo6m 47s
-
Test session flow and implement forwarding7m 37s
-
End HttpSession8m 33s
-
Redirecting outside an application3m 40s
-
Introduction to themes1m 48s
-
Define themes and theme resolver4m 18s
-
Define ThemeChangeInterceptor6m 38s
-
Pick themes on JSPs2m 37s
-
Introduction to l10n and i18n3m
-
Automatic locale resolution demo9m 55s
-
CookieLocaleResolver and interceptor for l10n and i18n5m 37s
-
-
-