1. in Eclipse, create a new Maven Project using the spring-mvc-jpa-archetype.2. add the spring-mobile-device dependency to pom. xml. [html] view plaincopy <dependency> <groupId> org. springframework. mobile </groupId> <artifactId> spring-mobile-device </artifactId> <version> 1.0.0.RELEASE </version> [html] </dependency> 3. add the following Spring Mobile interceptors in servlet-context.xml [html] <interceptors> [Html] <! -- Resolve the device that originated the web request --> [html] view plaincopy <beans: bean class = "org. springframework. mobile. device. DeviceResolverHandlerInterceptor"/> [html] <! -- Manage the user's site preference --> [html] <beans: bean class = "org. springframework. mobile. device. site. SitePreferenceHandlerInterceptor"/> [html] <! -- Redirects mobile users to domain.com/quickspringmobile/spring/m/ --> [html] <beans: bean class = "org. springframework. mobile. device. switcher. siteSwitcherHandlerInterceptor "factory-method =" urlPath "> <beans: constructor-arg value ="/m "/> [html] <beans: constructor-arg value = "/quickspringmobile/spring"/> [html] </beans: bean> [html] </interceptors> 4. the resolved device is available under the currentDevice request attribute. the site preference is available under the currentSitePreference request attribute. [html] www.2cto.com <annotation-driven> [html] <argument-resolvers> [html] <beans: bean class = "org. springframework. mobile. device. deviceWebArgumentResolver "/> [html] <beans: bean class =" org. springframework. mobile. device. site. sitePreferenceWebArgumentResolver "/> [html] </argument-resolvers> [html] </annotation-driven>