版权声明:本文为博主原创文章,未经博主允许不得转载。否则,吔屎伺候。 https://blog.csdn.net/guowujun321/article/details/78476199
@RequestMapping(value="/toplayindex",method={RequestMethod.POST,RequestMethod.GET})
public ModelAndView toKpointPlay(HttpServletRequest request,@PathVariable("Id") int Id){
//代码块
}
从网上查的资料:
@PathVariable 从路径里面去获取变量
@RequestParam 是从请求里面获取参数。
例如上面的方法 请求地址应为 /toplayindex/${id},如果没有在地址上加上id,会请求不到该方法。