May 2015
Intermediate to advanced
234 pages
4h 18m
English
A mobile user gets the mobile version of the website by default, but he/she may want to access some contents displayed only on the normal version. Spring Mobile offers the SitePreference object for that purpose, which is to be used instead of the Device object used in the previous recipe.
Follow these steps to create links, to switch between the normal version and the mobile version of a website:
DeviceResolverHandlerInterceptor bean and a SitePreferenceHandlerInterceptor bean and register them as interceptors:@Bean
public DeviceResolverHandlerInterceptor deviceResolverHandlerInterceptor() { return new DeviceResolverHandlerInterceptor(); } @Bean public ...Read now
Unlock full access