I have a post request in a jsp file:
<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>
The corresponding controller is:
@RequestMapping(value = "movieTheater", method = RequestMethod.POST)
public String submitTransaction(Model model, @RequestParam("balance") Double balance){
}
But when I am executing the jsp, I am getting the following error:
HTTP Status 400: The request sent by the client was syntactically incorrect (Required Double parameter 'balance' is not present).
Can you please point out to me where I am going wrong? Thanks in advance!
I got it solved! I was missing a '?' at the end of the url. The action should be:
Now everything is working fine!