I am brand new to Spring web MVC. I am trying to create a simple 1 paged site that will check the users browser and display the current theme for that browser.
If its a mobile app, I need to allow the user a button to switch to the regular site.
Also the current theme for mobile and non-mobile is stored in a database, which includes the start date, end date and the theme name. The theme name is the folder where the theme’s resources are located.
Being a beginner I have never used themeresolver.
Your help is much appreciated.
ThemeResolver is reasonably straightforward to implement.
You won’t be using the
setThemeName()method, so have it throw anUnsupportedOperationException. YourresolveThemeName()method would:You’ll then need to declare your implementation under ‘themeResolver’ name in your application context.