You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
363 B
Groovy
22 lines
363 B
Groovy
11 years ago
|
package org.test
|
||
|
|
||
|
@Controller
|
||
|
@EnableDeviceResolver
|
||
|
class Example {
|
||
|
|
||
|
@RequestMapping("/")
|
||
|
@ResponseBody
|
||
11 years ago
|
String helloWorld(Device device) {
|
||
11 years ago
|
if (device.isNormal()) {
|
||
11 years ago
|
"Hello Normal Device!"
|
||
11 years ago
|
} else if (device.isMobile()) {
|
||
11 years ago
|
"Hello Mobile Device!"
|
||
11 years ago
|
} else if (device.isTablet()) {
|
||
11 years ago
|
"Hello Tablet Device!"
|
||
11 years ago
|
} else {
|
||
11 years ago
|
"Hello Unknown Device!"
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
|
}
|