【问题标题】:Mixed content warning as a result of taglib URItaglib URI 导致的混合内容警告
【发布时间】:2016-11-14 13:56:35
【问题描述】:

我在 IE 11 中收到混合内容警告。 我的页面使用带有各种标签库和 Apache 磁贴的 struts2。 到目前为止,我无法理解是什么资源导致了此警告 - Fiddler 没有显示任何内容。

我的问题是:jsp页面中的taglib uris是否有可能导致混合内容警告: ""

在https中打开页面时,uri是http。

谢谢。

基里尔。

更新:

原因确实是一个标签,而是一个为客户端生成 Jvascript 代码的标签:

【问题讨论】:

    标签: https tiles struts2-jquery


    【解决方案1】:

    原因是下面的 s:url 标签:

     <s:url id="contextroot" includeContext="true"  forceAddSchemeHostAndPort="true"  value=""/>
    

    这个标签用于下一个访问JQuery主题:

    <sj:head jqueryui="true" jquerytheme="cupertino" customBasepath="%{contextroot}themes" locale="en" />
    

    这会在客户端页面中生成以下 HTML:

    <link id="jquery_theme_link" rel="stylesheet" href="http://xxx.xxx.xxx.com/reportcenter/themes/cupertino/jquery-ui.css?s2j=3.6.1" type="text/css"/>
    

    自从应用程序服务器运行在http中后就有了http。

    解决方案是删除 forceAddSchemeHostAndPort="true"。 这样路径是相对生成的:

    <link id="jquery_theme_link" rel="stylesheet" href="themes/cupertino/jquery-ui.css?s2j=3.6.1" type="text/css"/>
    

    【讨论】:

      【解决方案2】:

      https://blogs.msdn.microsoft.com/ieinternals/2009/06/22/handling-mixed-httpshttps-content/

      据此,您可能是正确的。您是否尝试过将 url 更改为 taglib uri 为 https?

      【讨论】:

      • 是的,我做到了。我得到异常 org.apache.jasper.JasperException: The absolute uri: tiles.apache.org/tags-tiles cannot be resolve in either web.xml or the jar files deploy with this application 我不明白它在哪里寻找 lib。这:“一个可能有用的技巧是使用“//example.com/image.gif”形式的协议相关超链接。”是我尝试的第一件事,它产生了同样的异常。
      猜你喜欢
      • 2018-03-19
      • 2010-10-17
      • 2016-06-22
      • 2017-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-03
      • 1970-01-01
      相关资源
      最近更新 更多