需要三个jar包
jackson-annotations-2.5.3.jar
jackson-core-2.5.3.jar
jackson-databind-2.5.3.jar
返回值类型-对象
~~~
@RequestMapping("/test2.action")
@ResponseBody
public Userinfo test2()
{
Userinfo u = new Userinfo();
u.setName("jj");
u.setSex("M");
u.setAge(20);
return u;
}
~~~
返回值类型-字符串
~~~
@RequestMapping("/test")
@ResponseBody
public String test()
{
return "{\"result\":true}";
}
~~~