Mapping restful ajax requests to spring

后端 未结 1 2106
闹比i
闹比i 2020-12-09 20:12

I have this piece of code:

@RequestMapping(value = \"/test.json\", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public @ResponseBody Object[] g         


        
相关标签:
1条回答
  • 2020-12-09 20:25

    @RequestBody/@ResponseBody annotations don't use normal view resolvers, they use their own HttpMessageConverters. In order to use these annotations, you should configure these converters in AnnotationMethodHandlerAdapter, as described in the reference (you probably need MappingJacksonHttpMessageConverter).

    0 讨论(0)
提交回复
热议问题