后端response响应输出结果到前端

//输出流 弹窗显示
public void returnMsg(HttpServletResponse response, ResponseDTO dto) {
    //设置编码格式
    response.setCharacterEncoding("UTF-8");
    response.setContentType("text/html;charset=utf-8");
    PrintWriter pw = null;
    try {
        pw = response.getWriter();
    } catch (IOException e) {
        throw new EpdataException("拦截创建printwriter失败");
    }
    pw.print("" +
            "" +
            "" +
            "" +
            "" +
            ""
    );
    pw.flush();
    pw.close();
}

你可能感兴趣的:(开发遇到的问题,前端,servlet,javascript,spring,boot,java)