SpringMVC-RESTful风格
RESTful 优点:轻量级,安全,效率高
Controller.java
@RequestMapping("/restful/{userid}/{itemid}")
//上面的参数和下面方法的对应对应 public String restful(@PathVariable("userid")int userid,@PathVariable("itemid")int itemid,ModelMap mm){ mm.addAttribute("userid", userid); mm.addAttribute("itemid", itemid); return "/restful.jsp"; }
浏览器访问
http://localhost:8089//SpringMVC_E004_EncodandRESTful/restful/1/4.do
显示
1,4