.net MVC 应用程序如何使用 JWS 与 Core java 桌面应用程序通信? [英] how .net MVC application can communicate with Core java desktop application using JWS?

查看:42
本文介绍了.net MVC 应用程序如何使用 JWS 与 Core java 桌面应用程序通信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个 Java 桌面应用程序,我们计划使用 JWS 启动该 Java 桌面应用程序,并且运行良好.

We have a java desktop application and we are planning to launch that java desktop application using JWS and that is working absolutely fine.

问题是——我们在网页上向用户询问一些与用户相关的信息,并使用 JWS 启动 Java 桌面应用程序.现在,我们希望用户在我们的 Java 应用程序的网页上提供该信息.请建议我们如何在java代码中访问这些信息?我们找到了两种方法——

The issue is -- we ask some user related information from user on web page and launch java desktop application using JWS. Now we would like to have that information provided by user on web page in our java application. Please suggest how we can access those information in java code ? We have find two approaches --

  1. Java 代码可以从 cookie 中读取该信息吗?我没有找到任何关于如何使用核心 Java 代码读取 cookie 的帮助?如果用户的桌面上没有启用 cookie 怎么办?

  1. Can java code read that information from cookies ? I have not find any help how to read cookies using core java code ? again what if cookies are not enable on user's desktop ?

我们可以使用 JNLP 文件传递​​信息吗?我们可以在 JNLP 文件中写入所有信息吗?可以作为参数传递给 java 代码吗?论点的长度在这里重要吗?我们可以通过其他方式从 JNLP 获取信息吗?

Can we pass information using JNLP file ? Can we write all information in JNLP file ? can pass as an argument to the java code ? does the length of the argument matter here ? can we get information from JNLP by some other way ?

请建议您是否比上述两种方法更了解另一种方法?

Please suggest if you know another approach better then these above two approaches?

推荐答案

我们可以排除方法 1.

We can rule out approach 1.

如果信息最少,则方法 2 很好.在我们的一个项目中,我们根据从 Web 界面接收到的信息动态生成 jnlp 文件,从而为用户定制了 java 应用程序.

Approach 2 is fine if the information is minimal. In one of our projects, we dynamically generated the jnlp file, based on information received from the web interface, which resulted in the java application being customized for the user.

您还可以让应用程序与后端通信(例如通过 http)并根据需要提取更多信息.

You could also have the application communicate with the backend (say over http) and pull more information as required.

这篇关于.net MVC 应用程序如何使用 JWS 与 Core java 桌面应用程序通信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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