我关注了可能的链接,发现我需要使用@Requestbody
注释,我需要在Content-Type=application/x-www-form-urlencoded
注释下的标头中设置@RequestMapping
。但我没有找到任何例子,比如我如何在浏览器中设置这些身体参数并进入控制器
@RequestMapping(value = "/login", headers="application/x-www-form-urlencoded" , method = RequestMethod.GET)
public void login(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServiceException {
// I need username and password body parameters value in controller
}