When trying to call getJSON like so
<script>
$("#version").keyup( function() {
var jarName = $("#artifactId").val();
var jarVersion = $("#version").val();
$.getJSON("/xx/yy/zz/"+jarName+"", jarVersion, function(completion) {
$("#version").autocomplete({
source: completion
});
});
});
</script>
with a back end like this
@RequestMapping(value = "/xx/yy/zz/{jarName}", method = {
RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public List<JsonNode> getVersionsAssociatedwithJar(@PathVariable String jarName, @RequestBody String version) {
I get a 400 bad request error and the url looks like so
xx/yy/zz/jarName?131.31
with the 131.31 what I am typing in on the front end and what I want as the "version" Param. Am I making a simple mistake with the request mapping? I've never used spring before but am finding it difficult to debug since it doesn't even get to the back end
Logger on Back end gives this message
[nio-8080-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing: public java.util.List<com.fasterxml.jackson.databind.JsonNode> com.lendingclub.macgyver.dependency.AppDependencyApiController.getVersionsAssociatedwithJar(java.lang.String,java.lang.String)