1

如何将 Java Applet 放入我的 .Net Web 应用程序?

我正在尝试以下代码

                        <applet code="com.griaule.fingerprintsdk.appletsample.FormMain" 
                        archive="C:\Users\lucas\workspace\applet-chave\bin\SignedFingerprintSDKJava.jar, C:\Users\lucas\workspace\applet-chave\bin\SignedFingerprintSDKJavaAppletSample.jar, C:\Users\lucas\workspace\applet-chave\bin\sqljdbc4.jar" height="550" width="550">
                    </applet>

但我收到以下错误

   java.net.MalformedURLException: unknown protocol: c
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at sun.plugin.util.ProgressMonitorAdapter.setProgressFilter(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.setupProgress(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
java.net.MalformedURLException: unknown protocol: c
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at sun.plugin.util.ProgressMonitorAdapter.setProgressFilter(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.setupProgress(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
java.net.MalformedURLException: unknown protocol: c
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at sun.plugin.util.ProgressMonitorAdapter.setProgressFilter(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.setupProgress(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

如果我将 .jar 插入到我的 .net 项目中,则会出现错误IllegalArgumentException,如果我在 jar 文件的路径之前插入 file:\,则会出现SecurityException我在评论中所说的错误。

4

1 回答 1

3

Java 小程序是使用 HTML 标记配置的,因此此处对 .Net 的引用无关紧要。

我猜您的问题在于您配置属性存档中定义的类路径的方式。那里指定的 jar 引用必须与您的代码库相关。它们不能是您机器上的绝对文件路径。

你应该写类似

first.jar,second.jar

并将罐子放在可以通过 HTTP 访问的位置

于 2012-07-23T20:34:57.680 回答