2

添付の jnlp ファイルを使用しています。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0//EN" "http://java.sun.com/dtd/JNLP-6.0.dtd">
  <jnlp spec="1.6+" version="1.0.7" codebase="http://localhost:8080/weasis/images"  href="viewer.jnlp&#063;username=<%=request.getParameter("username")%>">
    <information>
      <title>Weasis</title>
      <vendor>H&#244;pitaux Universitaires de Gen&#232;ve (HUG)</vendor>
      <homepage href="docs/help.html"/>
      <description>DICOM images viewer</description>
      <description kind="short">An application to visualize and analyze DICOM images.</description>
      <description kind="one-line">DICOM images viewer</description>
      <description kind="tooltip">Weasis</description>
      <icon href="images/logo-button.png" kind="default" />
      <icon href="images/about.png" kind="splash" />
      <shortcut online="false">
        <desktop/>
        <menu submenu="Weasis"/>
      </shortcut>
    </information>
    <security>
      <all-permissions/>
    </security>
    <resources>
      <!--  Requires Java SE 6 update 10 release for jnlp extension without codebase (substance.jnlp) -->
      <j2se version="1.6.0_10+" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="128m" max-heap-size="512m" />
      <j2se version="1.6.0_10+" initial-heap-size="128m" max-heap-size="512m" />
      <!-- Weasis launcher -->
      <jar href="weasis-launcher.jar" main="true" />
      <!-- OSGI Felix framework -->
      <jar href="felix.jar" />
      <!-- Optional library (Substance Look and feel, only since version 1.0.8). Requires the new Java Plug-in introduced in the Java SE 6 update 10 release.For previous JRE 6, substance.jnlp needs a static codebase URL -->
      <extension href="substance.jnlp"/>
      <!-- Allows to get files in pack200 compression, only available from Weasis 1.1.2 -->
      <property name="jnlp.packEnabled" value="true" />
      <!-- Required parameter. Define the location of config.properties (the OSGI configuration and the list of plug-ins to install/start) -->
      <property name="felix.config.properties" value="http://localhost:8080/weasis/conf/config.properties" />
      <!-- Required parameter. Define the code base of Weasis for the JNLP -->
      <property name="weasis.codebase.url" value="http://localhost:8080/weasis" />
      <!-- Required parameter. Start OSGI console on the port 17179 -->
      <property name="gosh.args" value="-sc telnetd -p 17179 start" />
      <!-- Optional parameter. Allows to have the Weasis menu bar in the top bar on Mac OS X (works only with the native Aqua look and feel) -->
      <property name="apple.laf.useScreenMenuBar" value="true" />
      <!-- Optional parameter. Allows to get plug-ins translations -->
      <property name="weasis.i18n" value="http://localhost:8080/weasis-i18n" />
      <!-- Optional Weasis Documentation, appears in the menu Help > User Manual -->
      <!-- <property name="weasis.help.url" value="http://localhost:8080/weasis-doc" /> -->

    </resources>
    <!-- Main class -->
    <application-desc main-class="org.weasis.launcher.WebstartLauncher">

      <argument>$dicom:get -l "<%=request.getParameter("username")%>"</argument>

    </application-desc>
  </jnlp>

jsp Web プロジェクトから jnlp ファイルを実行すると、url : viewer を使用するページが jnlp ファイルになります。

http://localhost:8080/Deleteasap/viewer.jnlp?username=lop

jnlp ファイルがダウンロードされ、次の例外が発生します。

MissingFieldException[ The following required field is missing from the launch file: <jnlp>(<application-desc>|<applet-desc>|<installer-desc>|<component-desc>)]
    at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
    at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
    at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
    at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
    at com.sun.javaws.Main.launchApp(Unknown Source)
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

私が間違っている場合は、これを行う方法を教えてください。ありがとう

4

0 に答える 0