如何在tomcat中部署和运行javafx应用程序 [英] How to deploy and run javafx application in tomcat

查看:507
本文介绍了如何在tomcat中部署和运行javafx应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有一个要求,从web-server在浏览器中运行javafx应用程序。我怎么能实现这个目标。



提前致谢。

解决方案

解决方案



将NetBeans构建输出的jar,jnlp和html文件的副本放入网络服务器的目录中,然后访问浏览器中的html文件。



例如,假设您调用了应用程序MyPowerApp和netbeans输出MyPowerApp.html,并且您希望将其部署到本地Tomcat服务器。 / p>


  1. 下载并安装Tomcat的副本( http://tomcat.apache.org/download-70.cgi

  2. 将jar,jnlp和html文件复制到tomcat的webapps / ROOT中目录。

  3. 启动tomcat。

  4. 通过 http:// localhost:8080 / MyPowerApp.html



  5. 小程序将自动启动,您可以单击链接以通过WebStart启动应用程序。



    更新应用程序只需在NetBeans中重建它,将其复制到tomcat webapps / ROOT目录并刷新浏览器链接(无需重启Tomcat)。



    在实践中你会想要修改html而不是使用生成的html在你网站的某个地方嵌入applet或WebStart链接(你不需要像Netbeans生成的样本那样在单个页面中使用这两种执行模式)。



    背景



    JavaFX应用程序无法在Tomcat中运行。



    Tomcat可用于托管嵌入JavaFX应用程序jar的html页面。安装并激活 JavaFX插件的浏览器可以下载来自Tomcat的JavaFX应用程序,并使用安装在客户端浏览器计算机上的Java运行时环境在浏览器窗口中执行应用程序。有关详细信息和 JavaFX部署指南。 =http://docs.oracle.com/javafx/2/get_started/basic_deployment.htm =noreferrer> JavaFX部署快速入门,以获取有关入门的简短信息。



    请注意,让JavaFX在各种客户端计算机上的浏览器中正常工作可能对您来说是一项艰巨的任务,因此您可能需要调查JavaFX部署指南中概述的备用部署方法(例如WebStart,独立或独立应用程序部署模式。)


    I have a requirement in my application ,Running the javafx application in browser from web-server. how can i achieve this thing.

    Thanks in advance.

    解决方案

    Solution

    Place a copy of the jar, jnlp and html file output by the NetBeans build into a directory of your webserver, then access the html file in your browser.

    For example, let's say you called your application MyPowerApp and netbeans output MyPowerApp.html and you wanted to deploy that to a local Tomcat server.

    1. Download and install a copy of Tomcat (http://tomcat.apache.org/download-70.cgi)
    2. Copy the jar, jnlp and html file into tomcat's webapps/ROOT directory.
    3. Start tomcat.
    4. Access your application via http://localhost:8080/MyPowerApp.html

    The applet will start automatically and you can click on the link to launch the application via WebStart.

    To update the application just rebuild it in NetBeans, copy it over into the tomcat webapps/ROOT directory and refresh your browser link (no need to restart Tomcat).

    In practice you will want to modify the html rather than use the generated html to embed either the applet or WebStart link somewhere on your website (you won't need both execution modes in a single page like the Netbeans generated sample).

    Background

    JavaFX applications do not run in Tomcat.

    Tomcat can be used to host a html page embedding a JavaFX application jar. A browser with the JavaFX plugin installed and activated can download the the JavaFX application from Tomcat and execute the application in the browser window using a Java runtime environment installed on the client browser machine. See the JavaFX Deployment Guide for more details and the JavaFX deployment quick start for short info on getting started.

    Note that getting JavaFX to work correctly in a browser across a wide range of client machines may prove a difficult task for you, so you may want to investigate alternate deployment methods as outlined in the JavaFX deployment guide (such as WebStart, Standalone or Self-contained application deployment modes).

    这篇关于如何在tomcat中部署和运行javafx应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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