Как вернуть JSON на проект javasful resfull с помощью jackson? (. 8.4 Создание клиента)Как зарегистрировать JacksonFeature на ClientConfig
После статьи http://www.vogella.com/tutorials/REST/article.html о создании проекта отдыха в Java, он говорит, что возвращение JSON проследовать как:
public class TodoTest {
public static void main(String[] args) {
ClientConfig config = new new ClientConfig().register(JacksonFeature.class);
Client client = ClientBuilder.newClient(config);
WebTarget target = client.target(getBaseURI());
System.out.println(target.path("rest").path("todo").request()
.accept(MediaType.APPLICATION_JSON).get(String.class));
}
private static URI getBaseURI() {
return UriBuilder.fromUri("http://localhost:8080_com.vogella.jersey.jaxb").build();
}
}
@XmlRootElement
public class Todo {
private String id;
private String summary;
private String description;
//getter/setter
}
Но JacksonFeature.class не в Jackson.jar. Я использую
jackson-annotations-2.8.2.jar
jackson-core-2.8.2.jar
jackson-databind-2.8.2.jar
jackson-jaxrs-base-2.8.2.jar
jackson-jaxrs-json-provider-2.8.2.jar
jackson-module-jaxb-annotations-2.8.2.jar
Как я мог решить эту проблему?