测试本地时清单中的代码库属性不匹配 [英] Codebase attribute in manifest mismatch when testing local

查看:15
本文介绍了测试本地时清单中的代码库属性不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 Java 1.7u25,您应该将 Codebase 属性添加到您的清单中,我已经这样做了.

As per Java 1.7u25 you should add the Codebase attribute to your manifest and I have done that.

但现在我无法在本地测试它,因为属性值与我的本地 JNLP 不匹配,由 Netbeans 生成,没有代码库值.

But now I can't test it locally as the the attribute value does not match my local JNLP, generated by Netbeans, wich have no codebase value.

清单对其代码库应该具有什么价值和/或我的 jnlp 中的代码库应该具有什么价值才能使其在本地工作?

推荐答案

有几种方法可以解决这个问题:

There's a few ways to approach this:

  1. 使用多个代码库属性:

您可以为 Codebase 属性提供多个值,从而也允许您添加本地地址.

You can supply multiple values to the Codebase attributes, thus allowing you to add local addresses as well.

例如:代码库:myproductiondomain.com localhost 127.0.0.1

使用通配符:

你也可以在Codebase属性中使用通配符属性,它可以有多种形式:

You can also use a wildcard attribute in the Codebase attribute, which can have multiple forms:

  • 例如Codebase: 127.0.0.1(注意,这不允许你使用localhost!!)
  • 例如更宽松的代码库:*
  • e.g. Codebase: 127.0.0.1 (beware, that doesn't allow you to use localhost!!)
  • e.g. a much more lenient Codebase: *

构建更改:

但更有可能的是,您应该修改构建系统以使用不同的 Codebase 属性生成测试和生产版本,以防止滥用.

But more likely, you should modify your build system to produce a test and a production version using different Codebase attributes to prevent abuse.

您需要的一切尽在防止 RIA 被重新利用:

特别注意接受通配符表中的那个有趣的花絮说,对于 127.0.0.1 条目:

Pay extra attention to that fun tidbit in the table of accepted wildcard saying, for the 127.0.0.1 entry:

不匹配 [...] http://localhost

这篇关于测试本地时清单中的代码库属性不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆