我在jsp文件中有一个发布请求:
<form method="post" action="http://localhost:8081/MerchantMovieTheater/api/movieTheater"> <input type="hidden" name="balance" id="balance" value="${balance}"/> <input type="submit" value="Merchant Site"> </form>
相应的控制器是:
@RequestMapping(value = "movieTheater", method = RequestMethod.POST) public String submitTransaction(Model model, @RequestParam("balance") Double balance){ }
但是,当我执行jsp时,出现以下错误:
HTTP Status 400: The request sent by the client was syntactically incorrect (Required Double parameter 'balance' is not present).
您能指出我哪里错了吗?提前致谢!
我解决了!我想念一个’?’ 在网址末尾。该动作应为:
action="http://localhost:8081/MerchantMovieTheater/api/movieTheater?">
现在一切正常!