摘要:
Behind the scenes, a HttpMessageConverter underpins reading therequest body and generating the responseMultiple converters may be registered for different content typesFor @RequestBody, the first converter that can read the POSTed "Content-Type" into the desired method parameter type is us 阅读全文
posted @ 2012-03-26 23:10
leaving
阅读(2902)
评论(0)
推荐(1)
摘要:
1.Return a POJO annotated with @ResponseBody:POJO marshaled as the body of the response @RequestMapping(value="/response/annotation", method=RequestMethod.GET) public @ResponseBody String responseBody() { return "The String ResponseBody"; } @RequestMapping(value="/response/c 阅读全文
posted @ 2012-03-26 22:53
leaving
阅读(259)
评论(0)
推荐(0)
摘要:
1.HttpServletRequest (or its more portable WebRequest wrapper)、Principal、Locale@RequestMapping(value="/data/standard/request", method=RequestMethod.GET)public @ResponseBody String standardRequestArgs(HttpServletRequest request, Principal user, Locale locale) { StringBuilder buffer = new St 阅读全文
posted @ 2012-03-26 22:43
leaving
阅读(532)
评论(0)
推荐(0)
摘要:
1. a query parameter value@RequestParam("name")2.a group of query parameter values//A custom JavaBean with a getName()/setName() pair for each parameter@RequestMapping(value="group")public @ResponseBody String withParamGroup(JavaBean bean) { return "Obtained parameter group 阅读全文
posted @ 2012-03-26 22:37
leaving
阅读(648)
评论(0)
推荐(0)
摘要:
1. by path@RequestMapping("path")2. by http method@RequestMapping("path", method=RequestMethod.GET)3. by presence of query parameter@RequestMapping("path", method=RequestMethod.GET, params="foo")Negation also supported: params={ "foo", "!bar&quo 阅读全文
posted @ 2012-03-26 22:28
leaving
阅读(475)
评论(0)
推荐(0)
摘要:
1. DispatcherServlet render Views Alternative to having a HttpMessageConverter write the response body Designed for generating text/* content from a template @RequestMapping(value="html", method=RequestMethod.GET) public String prepare(Model model) { model.addAttribute("foo", &qu 阅读全文
posted @ 2012-03-26 01:14
leaving
阅读(359)
评论(0)
推荐(0)
摘要:
<%@ page isELIgnored="false" %> 阅读全文
posted @ 2012-03-26 01:05
leaving
阅读(240)
评论(0)
推荐(0)