سؤال

Is it possible to return a List<String> as a JAXB response directly without wrapping it in a response object? E.g.,

public List<String> foo(Bar bar) {
    return restTemplate.postForEntity("http://foo.com/bar", bar, List.class);
}

Currently I get the error

Could not write request: no suitable HttpMessageConverter found for request type [my.pkg.Bar]

The HttpMessageConverters are properly configured as other GET/POST requests with Bar works.

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top