【发布时间】:2016-09-19 16:29:48
【问题描述】:
我需要在调用 servlet 时在客户端打开一个 Java Swing 应用程序。在通过 JNLP 在客户端浏览器上打开的 Swing 应用程序的 main 方法中也需要接收很少的参数。在我的情况下,swing 应用程序正在打开,但无论如何都没有收到任何参数。
我的 JNLP 文件不是动态构建的。它是一个静态文件。这里是:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"
codebase="http://localhost:8085/TestWebApp"
href="ContactEditor.jnlp">
<information>
<title>JNLP Example</title>
<vendor>Catalyst Software</vendor>
<homepage href="http://localhost:8085/TestWebApp" />
<description>JNLP Testing</description>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6+" />
<jar href="ContactEditor.jar" />
</resources>
<application-desc main-class="my.contacteditor.ContactEditorUI">
<argument>00001</argument>
<argument>Harish Prasad</argument>
<argument>220153429088</argument>
</application-desc>
<security>
<all-permissions/>
</security>
</jnlp>
请建议如何将参数从 servlet 动态传递到 swing 应用程序。
我的问题是:
- 我必须在我的 Swing 程序中编写什么代码?
- 我必须在 JNLP 文件中提及什么?
- 我应该如何从 servlet 传递值?
【问题讨论】:
-
请务必使用 JaNeLA 检查 JNLP,可在我的 share drive 获得。请注意,上面的 JNLP 有两个
<security>元素..
标签: java swing servlets java-web-start jnlp