All the source code in the project can be found in the linked repository ：https://github.com/chenhaoxiang/uifuture-ssm
In the previous explanation of components , There is talk about ThemeResolver Theme style parser , So how to apply it to the parser . In this section, we will explain an example . adopt Session Resolve the topic name to switch topics to load different css, Switch text color （ It can be configured in various other styles , Here's just a simple demonstration ）.
In view of the general trend of separation between the front and rear ends , There are many mature schemes for topic switching in large wireless terminals , Readers can be advised to know this part .
Spring MVC The theme is by org.springframework.ui.context.Theme Interface means .
Theme By ThemeSource Resolves the returned... According to the name of the topic . About ThemeSource The content of , stay 6.7.4 The section has already talked about . Need to be in Spring Created in Bean The name is ”themeSource” Of ResourceBundleThemeSource class .
Next, configure... In the project , In the realization of WebMvcConfigurer Interface MvcConfig Class to add methods . Such as code list 7-31 Shown .
Code list 7-31： establish ResourceBundleThemeSourc