POST乱码需要在 web.xml里面设置一个filter
配置如下:
restfulCharacterEncodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding utf-8 CharacterEncodingFilter *.html
//|RestFull @RequestMapping("/delete/{id}") public String hello3(@PathVariable int id) { System.out.println(id); return "index.jsp"; }访问 http://localhost::8080/delete/1.html,此时传入的就是 1