[英]How does a browser deal with applets?
我想知道當我的瀏覽器轉到這樣的網頁時會發生什么。 當我嘗試在Google中搜索“瀏覽器”和“小程序”時,多數情況下會發現如何將小程序添加到瀏覽器和故障排除,但找不到工作方式。
<html>
<head><title>My Applet</title></head>
<body>
<applet code="org/mypackage/MainClass.class" archive="MyApplet.jar,libA.jar,libB.jar" width="1600" height="860"></applet>
</body>
</html>
如果網頁是遠程的,那么我想瀏覽器必須將archive
參數中提到的所有jar archive
下載到某個臨時文件夾,然后瀏覽器要求Java Plugin進行下一步處理。 因此,插件將找到具有MainClass
jar並開始執行Java程序。
我的理解正確嗎?
我的小程序需要許多外部jar,因此我只將我的類打包到MyApplet.jar
。 然后放在另一個文件夾中
MyApplet.jar
libA.jar
libB.jar
applet.hmtl
然后雙擊applet.html
在MyApplet.jar的清單中有
Rsrc-Class-Path: ./ libA.jar libB.jar
Class-Path: .
確實有必要將這些行放在清單中嗎?
我的理解正確嗎?
基本上,根據需要或以編程方式禁止使用Java Web Start部署的applet並延遲下載Jars庫。
確實有必要將這些行放在清單中嗎?
如果罐子如下,則不需要在清單中引用它們。
applet
元素的archive
屬性中列出。 resources
部分中作為jar
元素列出。 這是從Java控制台回答我自己的問題:
CacheEntry[http://localhost/applet/MyApplet.jar]: updateAvailable=true,lastModified=Tue Jan 08 16:10:19 KST 2013,length=2128455
network: Connecting http://localhost/applet/MyApplet.jar with proxy=DIRECT
network: Connecting http://localhost:80/ with proxy=DIRECT
network: Downloading resource: http://localhost/applet/MyApplet.jar
Content-Length: 2,128,450
Content-Encoding: null
network: Wrote URL http://localhost/applet/MyApplet.jar to File C:\Users\Nikolay\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\0\1367c940-4740e460-temp
security: The jar file isnt signed so the blacklist check will be skipped
security: Trusted libraries list file not found
cache: Replacing MemoryCache entry (cnt=0) for http://localhost/applet/MyApplet.jarwas=com.sun.deploy.cache.CacheEntry (749595) now=com.sun.deploy.cache.CacheEntry (15535897)
basic: Applet loaded.
basic: Applet resized and added to parent container
basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 1039162 us, pluginInit dt 903077 us, TotalTime: 1942239 us
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.