@RequestMapping(value = "/connect{accountDeviceId}", method = RequestMethod.GET)
public @ResponseBody
String showCompleteAuthorizat(HttpServletRequest request,
HttpServletResponse response,
@RequestParam("accountDeviceId") int accountDeviceId) throws Exception {
我收到此错误
org.springframework.web.bind.MissingServletRequestParameterException: Required int parameter 'accountDeviceId' is not present
这是调用上述api
的网址http://localhost:8080/gch-restful/fitbit/connect29?oauth_token=b1e939450e745664ce4bbbc194b4ed47f&oauth_verifier=9dc1045654dc775d2347ae2963d5ae878c
我刚接触春天并基本上学习它,请告诉我这里我做错了什么。
此致
答案 0 :(得分:2)
您应该使用@PathVariable(value="accountDeviceId")
代替@RequestParam("accountDeviceId")
,以便从网址获取变量。