@ResponseBody

@Controller
public class PersonController {

    /**
     * 查询个人信息
     * 
     * @param id
     * @return
     */
    @RequestMapping(value = "/person/profile/{id}/{name}/{status}", method = RequestMethod.GET)
    public @ResponseBody
    Person porfile(@PathVariable int id, @PathVariable String name,
            @PathVariable boolean status) {
        return new Person(id, name, status);
    }

    /**
     * 登录
     * 
     * @param person
     * @return
     */
    @RequestMapping(value = "/person/login", method = RequestMethod.POST)
    public @ResponseBody
    Person login(@RequestBody Person person) {
        return person;
    }
}
    @RequestMapping(value = "/person/profile/{id}", method = RequestMethod.GET)
    public @ResponseBody
    Person porfile(@PathVariable("id") int uid) {
        return new Person(uid, name, status);
    }
原文地址:https://www.cnblogs.com/java-xu/p/5863988.html