My spring mvc controller has a method:
@RequestMapping(value = "/search", method = RequestMethod.POST)
public ModelAndView search(@RequestParam("cn") String cn) {
//do stuff
return mav;
}
And I have a JSP page, where I'd like to send the value of the string cn:
<html>
<head><title>Search Entry</title></head>
<body>
<h3>Search entry</h3>
<a href="search"><input type="text" name="cn" value="search">
<button type="submit">Search</button>
</a>
</body>
</html>
I'm sure the jsp has something wrong, now the status message says:
"Request method 'GET' not supported".
If I delete method = RequestMethod.POST it says:
"Required String parameter 'cn' is not present; description: The request sent by the client was syntactically incorrect"