SpringMobileModule

SpringMobileModule activates support for Spring Mobile in the Across context. By default ViewResolver beans will be configured for device specific views and DeviceType resolving will be enabled.

Configuration

By default the SpringMobileModule will configure the Across web ViewResolver beans to look for /mobile and /tablet specific views with fallback options. A LiteDeviceResolver will also be available along with a DeviceWebArgumentResolver. A DeviceBasedViewNameResolver can be wired to prepend view names with the prefix of the current device.

Once the SpringMobileModule is active, Thymeleaf and/or JSP views with the right prefixes will automatically be picked up.

Settings

The springMobile.deviceResolverRegistration property can be used to determine how the DeviceResolver should be registered. The resolver can be registered as a Servlet Filter for all servlets (default) or as a HandlerInterceptor. When registered as a HandlerInterceptor, the interceptor will apply to all prefixing contexts (this includes for example AdminWeb and DebugWeb).

The springMobile.deviceTypes property determines the list of DeviceType instances that are supported. View resolving for these types will be enabled.

Thymeleaf DeviceDialect

To use device-specific Thymeleaf fragments, a DeviceDialect is added. This allows the usage of the device:replace attribute which will replace the host tag by the device-specific fragment. Using device:replace is a drop-in alternative to th:replace for device-specific view support.