May 2015
Intermediate to advanced
234 pages
4h 18m
English
Instead of having to manually select the correct JSP in each controller method depending on the request device or site preference, use LiteDeviceDelegatingViewResolver provided by Spring Mobile.
In the Spring configuration class, replace any existing ViewResolver bean with a LiteDeviceDelegatingViewResolver bean:
@Bean
public LiteDeviceDelegatingViewResolver liteDeviceAwareViewResolver() {
InternalResourceViewResolver delegate = new InternalResourceViewResolver();
delegate.setPrefix("/WEB-INF/jsp/");
delegate.setSuffix(".jsp");
LiteDeviceDelegatingViewResolver resolver = new LiteDeviceDelegatingViewResolver(delegate);
resolver.setMobilePrefix("mobile/"); resolver.setEnableFallback(true); ...Read now
Unlock full access