Tell me, please, how to correctly respond from java @RestController to XMLHttpRequest from javascript.
@ResponseBody @RequestMapping(value = "/authorization", method = RequestMethod.POST) public String authorization( @RequestParam String login, @RequestParam String password) { System.out.println(login + " " + password); return "HelloWorld!"; } Javascript
formData.append("login", $("#login").val()); formData.append("password", $("#password").val()); formData.append("delete", document.getElementById("deleteCheck").checked); var xhr = new XMLHttpRequest(); xhr.open("POST", "authorization",false); xhr.send(formData); alert(xhr.responseText); In the controller, I see the login and password, but I don’t see it in the answer.