org.springframework.http.converter.HttpMessageNotWritableException:, cannot use ajax

1. Add dependency (pom.xml)

<dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.9.5</version>
</dependency>
<dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>2.9.5</version>
</dependency>

Here is the reference
2. Specify the Message object converter (springmvc.xml)

<mvc:annotation-driven>
   <mvc:message-converters>
      <bean class="org.springframework.http.converter.StringHttpMessageConverter"/>
      <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
   </mvc:message-converters>
 </mvc:annotation-driven>

Asynchronous interaction
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/NewDay_/article/details/109229947