看板 java 關於我們 聯絡資訊
大家好, 我寫了一個測試的applet(test.java)想放到網頁上執行 但是嘗試了很多種路徑的設定方法都還是失敗, 網頁的寫法大致是這樣 <applet code = "test.class" width = "300" height = "25"></applet> html檔與class檔放在同一個目錄下 在自己的電腦用appletviewer和ie開都沒問題 但是放到工作站後就一直顯示找不到test.class檔 (java.lang.ClassNotFoundException: test.class) 我有嘗試過的寫法: 1. 加入codebase = "./" ,仍失敗 2. 加入codebase = "http://網址/~帳號/" 3. code = "http://網址/~帳號/test.class" 4. code = "./test.class" 5. 加入classpath = "./" 6. codebase = "." 7. codebase = "/homepage/" ........ 大概想得到的排列組合通通亂套了 >"< 以上通通失敗.... 工作站上面的架構是這樣的 帳號目錄/homepage/test.html 帳號目錄/homepage/test.class 網頁網址是這樣 http://網址/~帳號/test.html 實在是想不到其它可以嘗試的路徑寫法 請大家幫幫我,謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.160.68.246
fillano:code="test" ? 12/15 09:19
Schematic:f大,找不到類別test 12/15 09:27
ogamenewbie:確認一下開 .class 會不會 404 12/15 09:55
Schematic:請問o大是說http://網址/~帳號/test.class嗎?403禁止 12/15 10:12
PsMonkey:你要不要直接給網址讓人測試? 12/15 16:44
ogamenewbie:403的話, client 有辦法加以運行嘛? XD 12/15 21:43
Schematic:o大的意思是我要改存取權限嗎? 12/15 21:44
ogamenewbie:我建議可以先弄那個 chmod 還 .htaccess 之類的 12/15 21:48
ogamenewbie:然後我不是 o大... 因為是小寫 (扯遠了 orz) 12/15 21:49
Schematic:成功了,感謝小o大大 XD 12/16 02:32