简单Spring MVC 列子:http://www.blogjava.net/pengo/archive/2010/11/28/339229.html

@controller@RequestMapping使用说明:

http://starscream.iteye.com/blog/1063966

Spring 返回json列子:

在controller中的方法前面加@ResponseBody就可以了

@RequestMapping(value="test1.htm",method=RequestMethod.GET)
public @ResponseBody Shop getShopInJson(@RequestParam(value="name") String name) {
System.out.println("运行");
Shop shop = new Shop();
shop.setName(name);
shop.setStaffName(new String[]{"mkyong1", "mkyong2"});
return shop;
}

 

SpringMVC中@ResponseBody的问题

http://www.open-open.com/home/space-124-do-blog-id-3118.html

相关文章:

  • 2022-12-23
  • 2021-11-24
  • 2021-08-21
  • 2021-07-15
  • 2021-07-06
  • 2021-11-06
  • 2021-10-23
猜你喜欢
  • 2022-12-23
  • 2022-02-04
  • 2022-12-23
  • 2022-01-23
  • 2021-08-11
  • 2021-06-14
相关资源
相似解决方案