SpringMVC 无法访问到controller的可能原因

来源:互联网 发布:asp公司网站源码 编辑:程序博客网 时间:2024/04/29 16:14
@RequestMapping(value="/toplayindex",method={RequestMethod.POST,RequestMethod.GET})

public ModelAndView toKpointPlay(HttpServletRequest request,@PathVariable("Id") int Id){

//代码块

}


从网上查的资料:

@PathVariable  从路径里面去获取变量

@RequestParam 是从请求里面获取参数。 

例如上面的方法 请求地址应为  /toplayindex/${id},如果没有在地址上加上id,会请求不到该方法。


阅读全文
0 0