Q:

Passing a list of strings in a Spring MVC controller using Jquery Ajax

i'm trying to pass a list of Strings to an MVC controller using JQuery Ajax, but i get the error No mapping for POST /myUrl/myContext/p
this is my jquery function:
$('#myButton').on('click', function(){
    var strings = [];
    $('#myForm input[type=checkbox]:checked').each(function(){
        var string = $(this).closest('tr').find('#mySpan').text();
        strings.push(string);
    });

    $.ajax({
        url : 'myContext/p',
        dataType : 'json',
        type: 'POST',
        data : {strings : strings},
        success: function(response) {
            //my success function           
            }
        },
        error: function(e) {
            //my error function
            }   
        }
    });

})

this is my controller:
@PostMapping(value="/myContext/p")
    public ResponseEntity<MyResponse> doPost(
            @RequestParam(value="strings" ,required=true) List<String> strings)
                    throws Exception{
        MyResponse response = new MyResponse();

        //my Code

        response.setData(strings);
        return new ResponseEntity<MyResponse>(response, HttpStatus.OK);
    }

A:

I fixed the issue with:
@PostMapping(value="/myContext/p", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, 
            produces = {MediaType.APPLICATION_ATOM_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
    public ResponseEntity<MyResponse> doPost( ArrayList<String> strings) throws Exception{
        MyResponse response = new MyResponse();

        //code

        response.setData(strings);
        return new ResponseEntity<RestResponse>(response, HttpStatus.OK);
    }

