Jnlp Signing test S-6ren">
gpt4 book ai didi

java - Jnlp 文件未在 Internet Explorer 浏览器中下载

转载 作者:行者123 更新时间:2023-12-02 12:20:16 67 4
gpt4 key购买 nike

我有 jsp 文件,其中包含带有动态参数的 jnlp 文件内容,如下所示,

<% response.setContentType("application/x-java-jnlp-file"); %>
<?xml version="1.0" encoding="utf-8"?>

<jnlp spec="1.0+" codebase="http://localhost:8080/testJnlp/" href="verifyDSC.jsp?param=<%=request.getParameter("param")%>">
<information>
<title>Jnlp Signing</title>
<vendor>test</vendor>
<homepage href="http://localhost:8080/testJnlp" />
<description>Signing</description>
</information>

<security>
<all-permissions/>
</security>

<resources>
<j2se version="1.6+"/>
<jar href="JnlpVerifyDSC.jar" main="true"/>
</resources>

<application-desc main-class="package.VerifyDSC">
<argument><%=request.getParameter("param")%></argument>
</application-desc>
<update check="background"/>
</jnlp>

如果我在 forefox&chrome 中执行上述文件,jnlp 文件将被下载并正常工作,但在 IE 中它会抛出“页面无法显示”错误。

您能告诉我如何解决这个问题吗?

最佳答案

通过将以下行添加到 jnlp 文件修复了该问题,

response.setHeader("Content-Disposition", "attachment; filename=verifyDSC.jnlp");

关于java - Jnlp 文件未在 Internet Explorer 浏览器中下载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45839666/

67 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com