Springboot:IE浏览器中@responseBody响应出现文件下载的解决办法

在Springboot项目中遇到IE浏览器显示@responseBody响应数据时触发文件下载的问题。针对这一问题,文章介绍了如何通过调整设置来避免在IE中出现此现象,确保JSON数据正常展示。
摘要由CSDN通过智能技术生成

     最近项目中在兼容ie浏览器时,springboot后台通过@responseBody响应数据时,返回的json字符串在ie中会出现下载文件的请求,界面上不能进行正确的响应。通过查找资料得到下面的解决办法:

package com.test.accountsystemmanage;


import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.HttpMessageConverters;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;
import java.util.List;

@SpringBootApplication
@EnableSwagger2
public class AccountsystemmanageApplication extends Spri
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值