一、问题出现场景

项目从http升级到https后,jsp页面存在发送http请求的情况下就会出现该异常。因为HTTPS 是 HTTP over Secure Socket Layer,以安全为目标的 HTTP 通道,所以在 HTTPS 承载的页面上不允许出现 http 请求。

二、解决办法

在jsp页面中,添加下面的meta头就可以了

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
</head>
<body>
<script type="text/javascript">
</script>
</body>
</html>

【Https异常】This request has been blocked; the content must be served over HTTPS的更多相关文章

  1. 在普通网页显示正常,加Https报This request has been blocked; the content must be served over HTTPS.,https网站加载http资源时,http资源被block

    解决办法 :在html头加<meta http-equiv="Content-Security-Policy" content="upgrade-insecure- ...

  2. Mixed Content: xxx This request has been blocked; the content must be served over HTTPS.

    在升级https的过程中,出现如下问题: Mixed Content: The page at 'https://www.xxx.com/denglu.html' was loaded over HT ...

  3. https下 http的会被阻塞 This request has been blocked; the content must be served over HTTPS.

    如何在HTTPS 网页中引入HTTP资源: Mixed Content? https://segmentfault.com/q/1010000005872734/a-1020000005874533 ...

  4. This request has been blocked; the content must be served over HTTPS.处理方案

    在页面head标签中加入 <meta http-equiv="Content-Security-Policy" content="upgrade-insecure- ...

  5. 网页中嵌入百度地图报错:The request has been blocked,the content must served over Https

    网页中嵌入百度地图 1.进入百度地图开发平台:http://lbsyun.baidu.com/index.php?title=jspopular 2.获取密钥:http://lbsyun.baidu. ...

  6. Cross-origin plugin content from must have a visible size larger than 400 x 300 pixels, or it will be blocked. Invisible content is always blocked.

    Cross-origin plugin content from  must have a visible size larger than 400 x 300 pixels, or it will ...

  7. (七)VMware Harbor 问题:Get https://192.168.3.135:8088/v2/: http:server gave HTTP response to HTTPS client

    (一)问题描述 登陆时,报错 docker Get https://192.168.3.135:8088/v2/: http:server gave HTTP response to HTTPS cl ...

  8. This content should also be served over HTTPS

    HTTPS 是 HTTP over Secure Socket Layer,以安全为目标的 HTTP 通道,所以在 HTTPS 承载的页面上不允许出现 http 请求,一旦出现就是提示或报错: jqu ...

  9. @RequestBody对象为空,异常Required request body is missing错误解决

    1.异常 org.springframework.http.converter.HttpMessageNotReadableException: Required request body is mi ...

随机推荐

  1. 从微信小程序开发者工具源码看实现原理(三)- - 双线程通信

    文章概览: 引言 小程序开发者工具双线程通信的设计 1.on: 用来收集小程序开发者工具触发的事件回调 2.invoke:以api方式调用开发工具提供的基础能力 3.publish:用来向Appser ...

  2. Python 之列表切片的四大常用操作

    最近在爬一个网站的文档的时候,老师要求把一段文字切割开来,根据中间的文本分成两段 故学习了一段时间的切片操作,现把学习成果po上来与大家分享 1.何为切片? 列表的切片就是处理列表中的部分元素,是把整 ...

  3. Promise代码详解(show you the code)

    认识异步函数 同步函数: const sum1 =(a,b)=>{ return a+b } console.log('AAA'); console.log(sum(5,6)); conosle ...

  4. CentOS 线上搭建 jupyter_server 笔记

    一.背景 为公司负责 Data Science 的同事配置线上 jupyter_server (jupyter + jupyter_kernel_gateway)环境. 二.环境 CentOS 7.6 ...

  5. VO(视图模型) 与 DTO(数据传输对象)的区别

    目录 VO(视图模型) 与 DTO(数据传输对象)的区别 1.VO与DTO概念 2.VO 视图模型的必要性与解耦 2.1 视图模型 2.2 视图模型存在的必要性 2.3 视图模型的解耦 3.DTO 存 ...

  6. Ligg.EasyWinApp-100-Ligg.EasyWinForm:一款Winform应用编程框架和UI库介绍

        本项目是一个Winform应用编程框架和UI库.通过这个该框架,不需任何代码,通过XML配置文件,搭建任意复杂的Windows应用界面,以类似Execel公式的方式实现基本的过程控制(赋值.条 ...

  7. Dynamics 365客户端编程示例:获取当前用户的信息,表单级通知/提示,表单OnLoad事件执行代码

    我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...

  8. SpringAOP(注解方式实现面向切面编程)之常用Before、After、Around

    一.首先在Springmvc.xml文件中引入如下内容(本示例是在ssm框架基础上实现的) 1.引入命名空间 xmlns:aop="http://www.springframework.or ...

  9. 32.Java基础_异常

    JVM虚拟机默认异常处理机制 Java异常处理: 1.try...catch... 2.throw 1.try...catch... public class test{ public static ...

  10. 09-Node.js学习笔记-异步编程

    同步API,异步API 同步API:只有当前API执行完成后,才能继续执行下一个API console.log('before'); console.log('after'); 异步API:当前API ...