Add Spring Mobile Device Resolver autoconfiguration

This commit is contained in:
Roy Clarkson
2013-09-26 10:26:45 -04:00
committed by Dave Syer
parent f306eda703
commit 5cdaa43912
9 changed files with 299 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
package org.test
@Controller
@EnableDeviceResolver
class Example {
@RequestMapping("/")
@ResponseBody
public String helloWorld(Device device) {
if (device.isNormal()) {
return "Hello Normal Device!"
} else if (device.isMobile()) {
return "Hello Mobile Device!"
} else if (device.isTablet()) {
return "Hello Tablet Device!"
} else {
return "Hello Unknown Device!"
}
}
}