Parameters 将参数传递给javafx web start应用程序

Parameters 将参数传递给javafx web start应用程序,parameters,javafx,java-web-start,Parameters,Javafx,Java Web Start,我使用JavaWebStart启动了一个JavaFX应用程序。我正试图向它传递一个参数,但到目前为止我还没有成功。我已尝试遵循部署工具包中给出的示例。这就是我现在对一切的看法 HMTL: <html> <head> <title>Parameter Testing</title> <meta http-equiv="Content-Type" content="text/html; charset=UT

我使用JavaWebStart启动了一个JavaFX应用程序。我正试图向它传递一个参数,但到目前为止我还没有成功。我已尝试遵循部署工具包中给出的示例。这就是我现在对一切的看法

HMTL:

<html>
    <head>
        <title>Parameter Testing</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    </head>
    <body>
        <h1>Parameter Passing Test</h1>
        <script src="http://java.com/js/dtjava.js"></script>
        <script>
            function launchApplication() {
                dtjava.launch({url: 'ParamTesting.jnlp', params:{order: "852237"}}, {jvm: '1.7.0_72+', javafx: '2.2+'}, {});
                return false;
            }
        </script>
        <a href='ParamTesting.jnlp' onclick="return launchApplication();">
            <img src="images/jws-launch-button.png" width="88" height="23"/>
        </a>
    </body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" xmlns:jfx="http://javafx.com" href="ParamTesting.jnlp">
    <information>
        <title>Param Testing</title>
        <vendor>USGS</vendor>
    </information>
    <security>
        <all-permissions/>
    </security>
    <update check="always" policy="always" />
    <resources>
        <j2se version="1.7.0_72+" href="http://java.sun.com/products/autodl/j2se" />
        <jar href="ParamTesting.jar" main="true" version="0.1"/>
        <property name="jnlp.versionEnabled" value="true"/>
    </resources>
    <application-desc name="ParamTesting"/>
    <jfx:javafx-desc main-class="gov.usgs.tnm.paramtesting.MainApp" name="MainApp">
        <fx:param name="order" value="852237"/>
    </jfx:javafx-desc>
</jnlp>
public void start(Stage stage) throws Exception {
    System.out.println(getParameters().getNamed().get("order"));

    Parent root = FXMLLoader.load(getClass().getResource("/fxml/Scene.fxml"));

    Scene scene = new Scene(root);
    scene.getStylesheets().add("/styles/Styles.css");

    stage.setTitle("Parameter Testing");
    stage.setScene(scene);
    stage.show();
}
每次我运行它时,控制台中都会打印“null”。我想不出哪里出了问题


此外,此应用程序确实有一个与之关联的订单系统,因此参数需要是动态的。如果有人对我如何实现这一目标有任何见解,我将不胜感激。

我发现了我的问题。我不需要JNLP中的application Descripte元素。我不知道为什么把它放在那里会导致JavaFX程序无法访问参数,但它确实可以