动态 JNLP 生成和 Excel 调用

发布于 2024-09-18 14:46:03 字数 655 浏览 2 评论 0 原文

我有一个通过 Java Webstart 调用的应用程序。通过 Webstart 链接打开它没有任何问题。

我还有一个基于 Excel 的应用程序,它生成文件(通过 vba),然后可以由通过 Webstart 启动的程序打开这些文件。

我想做的是有一个按钮来调用 Webstart 应用程序,然后打开一个新生成的文件。文件名(和内容)对时间敏感,因此我不能一遍又一遍地使用相同的文件名。

我几乎已经弄清楚如何使用 vba 通过 Webstart 调用应用程序,但问题是,为了使 Webstart 应用程序能够打开文件,需要将其作为 jnlp 描述符中的参数传递进去,

<application-desc main-class="com.foo.WebstartApp">
    <argument>-file</argument>
    <argument>C:\files\file_20100909_164834.csv</argument>
</application-desc>

你该怎么做当文件名始终不同时,如何将文件名传递到 JNLP 文件中?

我是否应该考虑每次动态生成一个新的 jnlp 文件,或者是否有一种方法可以参数化 jnlp 文件并在调用 JNLP 时传递文件名?

I have an application which is invoked via Java Webstart. Opening it via the Webstart link works without any issue.

I also have an application based on Excel that generates files (via vba) which can then be opened by the program that starts via Webstart.

What I would like to do is have a button that invokes the Webstart application and then opens a newly generated file. The files name (and contents) are time sensitive and so I can't use the same file name over and over.

I've pretty much figured out how to use vba to invoke the application via Webstart but the problem is that for the Webstart app to be able to open a file it needs to be passed in as an argument in the jnlp descriptor

<application-desc main-class="com.foo.WebstartApp">
    <argument>-file</argument>
    <argument>C:\files\file_20100909_164834.csv</argument>
</application-desc>

How do you go about passing through the filename into the JNLP file when the filename will always be different?

Should I be looking at dynamically generating a new jnlp file each time, or is there a way to parameterize the jnlp file and pass through the filename when invoking the JNLP?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

Bonjour°[大白 2024-09-25 14:46:03

动态生成的 JNLP 文件可能会让您面临注入攻击,就像动态 SQL 一样。此外,您似乎希望用户信任 WebStart 应用程序,而该应用程序又信任不可信的 JNLP 文件。

假设每个桌面有一个应用程序实例 (SingleInstanceService),有关要使用哪些文件的信息(不一定是可信的)可以使用 PersistenceService 通过小程序传递( “松饼”)或者,显然如果浏览器是 IE,则通过 cookies。

Dynamically generated JNLP files is probably going to open you up to injection attacks, just like dynamic SQL. Further it looks as if you are expecting the user to trust the WebStart application which trusts the JNLP file which is untrustworthy.

Assuming you have one application instance per desktop (SingleInstanceService), information about which files to use, which should not necessarily be trusted, can be passed through an applet using the PersistenceService ("muffins") or, apparently if the browser is IE, through cookies.

口干舌燥 2024-09-25 14:46:03

我找到了适合我需求的解决方案。自定义 servlet 用于修改 URL 字符串中的参数。

http://forums.sun.com/thread.jspa?threadID=714893

I've found a solution that suits my needs. A custom servlet is used to modify parameters in the URL string.

http://forums.sun.com/thread.jspa?threadID=714893

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文