@PathVariable请求类型,报错,为什么

J2EE 码拜 8年前 (2016-09-27) 1519次浏览
java代码?
@RequestMapping(value = “imageHandle/{id}”, method = RequestMethod.GET)
public String imageHandle(@PathVariable(“id”) Integer id,Model model) {
model.addAttribute(“a”,”1″);
model.addAttribute(“img”, id);
return “front/index”;
}
url:http://localhost:8080/daoqi/oa/imageHandle?id=1
jsp:<body>
hello!
<p>${a}</p>
<p>${img}</p>
</body>
jsp为什么404?
————————————————————————————————-
假如
@PathVariable(“id”) String id
url:
http://localhost:8080/daoqi/oa/imageHandle/id=”1″
可以跳转页面,并显示参数
jsp:
hello!
1
id=”1″
跪求,高手!
解决方案

40


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明@PathVariable请求类型,报错,为什么
喜欢 (0)
[1034331897@qq.com]
分享 (0)