摘要:
@ResponseBody @RequestMapping(value="/ip", method=RequestMethod.GET) public String getIP(HttpServletRequest request, HttpServletResponse res... 阅读全文
摘要:
@RequestMapping(method=RequestMethod.GET) public ModelAndView allUsers(@RequestParam int page){ ModelAndView mav = new ModelAndView(); ... 阅读全文
摘要:
@RequestMapping(value="/del/{id}") public String delUser(@PathVariable int id){ return "redirect:/user"; }直接返回redirect:/user,就可以返回到user页面... 阅读全文
摘要:
1、在lib中加入jackson.jar包2、在请求函数上进行标注返回类型,ResponseBody也可以放上边 @RequestMapping(value="/json",method=RequestMethod.GET, produces="application/json;charset... 阅读全文
摘要:
@RequestMapping(value="/{id}/{name}", method=RequestMethod.GET) public ModelAndView getUrlVariable(@PathVariable int id, @PathVariable String name)... 阅读全文
摘要:
1、自动注入Model参数,对model变量添加属性。@Controller@RequestMapping("user")public class UserController { @RequestMapping(method=RequestMethod.GET) public ... 阅读全文