spring mvc 避免IE执行AJAX时,返回JSON出现下载文件

<!-- 避免IE执行AJAX时,返回JSON出现下载文件 -->

<bean id="mappingJacksonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
  <property name="supportedMediaTypes">
    <list>
      <value>text/html;charset=UTF-8</value>
    </list>
  </property>
</bean>

<!-- 启动Spring MVC的注解功能,完成请求和注解POJO的映射 -->

<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
  <property name="messageConverters">
    <list>
      <ref bean="mappingJacksonHttpMessageConverter" /><!-- json转换器 -->
    </list>
  </property>
</bean>

去掉<mvc:annotation-driven/>

上一篇:xmapp配置下报错mysqli::real_connect(): (HY000/1045): Access denied for user ‘pum‘@‘localhost‘ (using pass


下一篇:Building gRPC Client iOS Swift Note Taking App