Hi everyone i'm trying to send data as param to spring mvc method that should catch param using @RequestParam :
@ResourceMapping(value="send")
public void send(ResourceResponse response,@RequestParam("message") String message) throws JsonGenerationException, JsonMappingException, IOException{
System.out.println("send method invocked");
System.out.println("message === >" + message);
.........
and my angular JS script (not work) is as follow
var message = "message="+JSON.stringify({
"name" : $scope.message.name ,
"email" : $scope.message.email ,
"tel": $scope.message.tel,
"id_subject":$scope.message.selectedSubject ,
"content" : $scope.message.content
});
console.log("valid");
$http.post('${send}', message)
.success(function(data, status, headers, config) {
})
.error(function(data, status, headers, config) {
});
method from controller throw exception (Required String parameter 'message' is not present) please help