HTTP Status 406---not acceptable according to the request "accept" headers

Source: Internet
Author: User

The resource identified by this request is a capable of generating responses with characteristics not acceptable accord ing to the request "accept" headers.

Use the following scenarios to resolve

SPRINGMVC JSON configuration Scheme

Spring4.1.0

Use the <annotation-driven/>mvc configuration method.

Increase in Pom.xml

1        <Dependency>2             <groupId>Com.fasterxml.jackson.core</groupId>3             <Artifactid>Jackson-core</Artifactid>4             <version>2.4.3</version>5         </Dependency>6         <Dependency>7             <groupId>Com.fasterxml.jackson.core</groupId>8             <Artifactid>Jackson-databind</Artifactid>9             <version>2.4.3</version>Ten         </Dependency> One         <Dependency> A             <groupId>Com.fasterxml.jackson.core</groupId> -             <Artifactid>Jackson-annotations</Artifactid> -             <version>2.4.3</version> the         </Dependency>

Adding @org.springframework.web.bind.annotation.responsebody annotations to the Controller method

You can resolve the issue in the title

HTTP Status 406---not acceptable according to the request "accept" headers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.