@Controller
@RequestMapping(value={"/foo","/bar"})
public class ExampleController
extends Object
| Constructor and Description |
|---|
ExampleController() |
| Modifier and Type | Method and Description |
|---|---|
String |
getColor(String userId,
boolean normalize)
Retrieves the stored color for a particular user.
|
String |
postExample(int value)
Simply adds the value provided via the query parameter to a running total.
|
String |
setColor(String userId,
String value)
Stores the color for a particular user
|
@RequestMapping(value="/add",
method=POST,
produces="text/plain")
@ResponseBody
public String postExample(@RequestParam
int value)
value - Value to be added to a running total.@RequestMapping(value="/user/{name}/color",
produces="text/plain")
@ResponseBody
public String getColor(@PathVariable(value="name")
String userId,
@RequestParam(required=false)
boolean normalize)
userId - user id of the user.normalize - Determines whether the result will be standardized@RequestMapping(value="/user/{name}/color",
method={POST,PUT},
consumes="application/json",
produces="text/plain")
@ResponseBody
public String setColor(@PathVariable(value="name")
String userId,
@RequestBody
String value)
userId - User id of the user.value - The color value to store for the userCopyright © 2013-2015 Calrissian. All Rights Reserved.