How to pass email id via ajax call (not as string), i need to catch that email parameter in spring controller.
$.ajax({
type : "POST",
contentType : "application/json",
data: data,
dataType: "text",
url : "<%=request.getContextPath()%>/methodName";,
success : function(data){
}
});
Java code:
@RequestMapping(value="/methodName/{email}", method =RequestMethod.POST,produces="application/json")
@ResponseBody
public String resetPassword(@PathVariable(value = "email") String email) throws Exception{
//do something
return "success";
}