我可以在包中使用小程序吗?即:
bfwd.RedemptionOnline.client
将是包,RedemptionOnlineApplet.class将存在于该包中。如果可以的话,如果它存在于RedemptionOnline.jar中,你将如何为它创建标记?
这是我正在使用的标签:
<applet code="bfwd/RedemptionOnline/client/RedemptionOnlineApplet" width="1" height="1" archive="RedemptionOnline.jar">
<PARAM NAME="MAYSCRIPT" VALUE="true">
</applet>
这是我得到的错误的日志:
Java Plug-in 10.0.0.147
Using JRE version 1.7.0-b147 Java HotSpot(TM) Client VM
User home directory = C:\Users\LordZardeck
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
basic: Added progress listener: sun.plugin.util.ProgressMonitorAdapter@1b1a66b
basic: Plugin2ClassLoader.addURL parent called for http://localhost/redemption/RedemptionOnline.jar
network: Cache entry found [url: http://localhost/redemption/RedemptionOnline.jar, version: null] prevalidated=false/0
network: Connecting http://localhost/redemption/RedemptionOnline.jar with proxy=DIRECT
network: Connecting http://localhost:80/ with proxy=DIRECT
network: Connecting http://localhost/redemption/RedemptionOnline.jar with cookie "PHPSESSID=loub2i9mprilg7ihvjn8g960v1"
network: ResponseCode for http://localhost/redemption/RedemptionOnline.jar : 304
network: Encoding for http://localhost/redemption/RedemptionOnline.jar : null
network: Disconnect connection to http://localhost/redemption/RedemptionOnline.jar
cache: Reading Signers from 5 http://localhost/redemption/RedemptionOnline.jar | C:\Users\LordZardeck\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\4\40bb90c4-62ab3bc6.idx
network: No certificate info for unsigned JAR file: http://localhost/redemption/RedemptionOnline.jar
cache: Read manifest for http://localhost/redemption/RedemptionOnline.jar: read=82 full=82
network: Cache entry not found [url: http://localhost/redemption/, version: null]
network: Cache entry not found [url: http://localhost/redemption/bfwd/RedemptionOnline/client/RedemptionOnlineApplet.class, version: null]
network: Connecting http://localhost/redemption/bfwd/RedemptionOnline/client/RedemptionOnlineApplet.class with proxy=DIRECT
network: Connecting http://localhost/redemption/bfwd/RedemptionOnline/client/RedemptionOnlineApplet.class with cookie "PHPSESSID=loub2i9mprilg7ihvjn8g960v1"
network: Cache entry not found [url: http://localhost/redemption/bfwd/RedemptionOnline/client/RedemptionOnlineApplet.class, version: null]
network: Connecting http://localhost/redemption/bfwd/RedemptionOnline/client/RedemptionOnlineApplet.class with proxy=DIRECT
network: Connecting http://localhost/redemption/bfwd/RedemptionOnline/client/RedemptionOnlineApplet.class with cookie "PHPSESSID=loub2i9mprilg7ihvjn8g960v1"
java.lang.ClassNotFoundException: bfwd.RedemptionOnline.client.RedemptionOnlineApplet
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: load: class bfwd/RedemptionOnline/client/RedemptionOnlineApplet not found.
java.lang.ClassNotFoundException: bfwd.RedemptionOnline.client.RedemptionOnlineApplet
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: Removed progress listener: sun.plugin.util.ProgressMonitorAdapter@1b1a66b
security: Reset deny session certificate store
答案 0 :(得分:1)
是的,小程序可以在软件包中 - 虽然我建议您遵循约定并将软件包命名为
com.bfwd.redemptiononline.client
创建标记时,您只需指定完全限定名称:
com.bfwd.redemptiononline.client.RedemptionOnlineApplet.class
或者可能(文档各不相同,自从我完成任何applet工作以来已经很长时间了)
com.bfwd.redemptiononline.client.RedemptionOnlineApplet
甚至:
com/bfwd/redemptiononline/client/RedemptionOnlineApplet.class
答案 1 :(得分:1)
如果您的Applet类打包在可由http://example.com/RedemptionOnline.jar下载的JAR文件中,那么您应该在code
中指定打包类的完全限定名称,并在({relative})中指定(相对)公共Web URL。 archive
中的JAR文件(注意:区分大小写!):
<applet code="bfwd.RedemptionOnline.client.RedemptionOnlineApplet" archive="RedemptionOnline.jar">
(我同意Jon的说法,包名应该是小写的,符合Java Naming Conventions)
如果您的Applet类只是公共Web内容中的.class
文件,可由http://example.com/bfwd/RedemptionOnline/client/RedemptionOnlineApplet.class下载,那么您应该在code
中准确指定其(相对)公共网址(注意:也区分大小写!):
<applet code="bfwd/RedemptionOnline/client/RedemptionOnlineApplet.class">
您现在是否了解何时使用句点以及何时使用斜杠以及何时使用后缀.class
?