2015-01-07 141 views
0

假設我們有這種Java applet放置在HTML頁面中。HTML中的Java小程序。 JAR執行

<applet code="test.class" archive="test_archive.jar"></applet> 

難道WEB瀏覽器將執行「test_archive.jar」文件即使這樣的類文件「的Test.class」不可達(導致HTTP 404)? 此外,是否有可能在HTML頁面中編寫Java applet,只需要jar文件就可以在WEB瀏覽器中執行它?

+0

我會問從另一個角度相同。假設用戶A在瀏覽互聯網時按下每個彈出窗口。壞角色B創建並簽名包含特洛伊木馬的Java檔案「test_archive.jar」,然後將其放置在某個HTML頁面中。但是B犯了一個錯誤,錯誤地輸入了HTML applet標籤中的.class文件名,所以用戶的A瀏覽器沒有拉這個.class文件(JAR文件下載成功)。問題,在這裏有沒有.class文件執行Java歸檔的可能性? – Vaidas

+0

1)'test.class' ***裏面是否有''test_archive.jar'? 2)*「另外,是否可以在HTML頁面中編寫Java applet,只需要jar文件就可以在WEB瀏覽器中執行它?」*我不確定我是否明白你的意思。如果applet在罐子裏面,那麼是的,這是可能的。 –

回答

0
//Here is applet tag code you coan put in web page which one load YourApplet 
// Remember when you try to access your applet out side your system then YourApplet should be digitally signed 
<APPLET code="YourApplet.class" archive="YourApplet.jar" codebase="http://www.example.com/yourbase_directory_where_YourApplet.jar_file_exits/" width=250 height=150> 
when applet load from this location it is use the codebase directory