JNLP 作为 HTML 页面中的 Applet
我试图在 HTML 页面中运行 JNLP,但 java 插件不运行 JNLP,只运行 Applet。
这是我的代码:
<applet width="800" height="500" codebase="http://127.0.0.1:8888/applets/"
code="br.com.app.server.utils.CompatibilityApplet"
archive="CompatibilityApplet.jar">
<param name="jnlp_ref" value="http://127.0.0.1:8888/applets/testehellojws.jnlp">
</applet>
谢谢。
[编辑]
示例:
http://java .sun.com/javase/ja/6/ea/6u10/plugin2/jnlp/CompatibilityApplet.java
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="6.0+" codebase="http://127.0.0.1:8888/applets/" href="testehellojws.jnlp">
<information>
<title>App Hello</title>
<vendor>My App Jnlp.</vendor>
<homepage href="http://127.0.0.1:8888/Home.html"/>
<description>My App Jnlp</description>
<description kind="short">Appr</description>
<icon href="images/icone.jpg"/>
</information>
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="hello.jar" main="true"/>
</resources>
<application-desc main-class="br.com.app.server.HelloJWS"></application-desc>
</jnlp>
请编辑您的问题并让我知道它已编辑。
好的
您错过了有关文档库的部分吗?
我没有。
我建议删除小程序名称属性中的空格。
完毕
您可以运行任何其他 JNLP 嵌入式小程序吗? EG 我网站上的小型(沙盒)GIFanim 小程序?
是的
什么信息。你会从这里收到举报吗?
java.供应商:Sun Microsystems Inc.
java.版本:1.6.0_26
操作系统名称:Windows 7
操作系统版本:6.1
I'm trying to run my JNLP within an HTML page, but the java plugin does not run the JNLP, runs only the Applet.
Here is my code:
<applet width="800" height="500" codebase="http://127.0.0.1:8888/applets/"
code="br.com.app.server.utils.CompatibilityApplet"
archive="CompatibilityApplet.jar">
<param name="jnlp_ref" value="http://127.0.0.1:8888/applets/testehellojws.jnlp">
</applet>
Thanks.
[EDIT]
An example:
http://java.sun.com/javase/ja/6/ea/6u10/plugin2/jnlp/CompatibilityApplet.java
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="6.0+" codebase="http://127.0.0.1:8888/applets/" href="testehellojws.jnlp">
<information>
<title>App Hello</title>
<vendor>My App Jnlp.</vendor>
<homepage href="http://127.0.0.1:8888/Home.html"/>
<description>My App Jnlp</description>
<description kind="short">Appr</description>
<icon href="images/icone.jpg"/>
</information>
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="hello.jar" main="true"/>
</resources>
<application-desc main-class="br.com.app.server.HelloJWS"></application-desc>
</jnlp>
Please edit your question and just let me know it is edited.
OK
Did you miss the part about the documentBase?
I didn't.
I would recommend removing the space in the applet name attribute.
Done
Can you run any other JNLP embedded applets? E.G. the small (sand-boxed) GIFanim applet at my site?
Yes
What info. do you get reported from here?
java.vendor: Sun Microsystems Inc.
java.version: 1.6.0_26
os.name: Windows 7
os.version: 6.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是 Java 应用程序(而不是 applet)的描述符。对于小程序,使用更像......
注意:
documentBase
、name
、width
&高度
。请参阅 applet-desc JNLP 文件语法部分了解更多详细信息。That is the descriptor for a Java application (as opposed to an applet). For an applet, use something more like..
Note:
documentBase
,name
,width
&height
. See the applet-desc section of the JNLP File Syntax for more details.您的
jnlp_ref
可能应该是一个绝对URI,例如http://127.0.0.1:8888/applets/testehellojws.jnlp
此外,您的开头还有一个杂散空格
code
值(尽管这可能不是问题的原因。)Your
jnlp_ref
should probably be an absolute URI, e.g.http://127.0.0.1:8888/applets/testehellojws.jnlp
Also there is a stray space at the start of your
code
value (though this is probably not the cause of your problem.)查看相关帖子后,我决定测试该标签
。
我认为这不适用于 JNLP,所以我们之前测试过。
更改
为
并引用我的 jnlp 文件作为参数后,它起作用了!
浏览器忽略代码和存档参数并运行我的 JNLP。
谢谢。
Checking on a related post, I decided to test the tag
.
I thought that this would not work with JNLP, so we had tested before.
After changing
to
and referencing my jnlp file as a parameter, it worked!
The browser ignores the code and archive parameters and run my JNLP.
thanks.
尝试删除 [archive="CompatibilityApplet.jar"]
Try to remove [archive="CompatibilityApplet.jar"]