کد applet نوشته شده را نمیتوانم در Browser ببینم.
package org.test;
import java.applet.*;
import java.awt.*;
public class Main extends Applet
{
public void init()
{}
public void stop()
{}
public void paint(Graphics g)
{
g.drawString("Salam Applet",20,20);
}
}
کد صفحه jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>salam applet</title>
</head>
<body>
<jsp:plugin type="applet" code="org.test.Main.class" width="400" height="400">
<jsp:fallback>
<p>Unable to load applet HEHE</p>
</jsp:fallback>
</jsp:plugin>
</body>
</html>
البته خود applet در کامپیوتر من اجرا میشود ولی پس از اجرا در مرورگر با این خطا روبرو میگردد.
Java Plug-in 1.6.0_23
Using JRE version 1.6.0_23-b05 Java HotSpot(TM) Client VM
User home directory = C:\Users\hardcode
----------------------------------------------------
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>
----------------------------------------------------
load: class org.test.Main.class not found.
java.lang.ClassNotFoundException: org.test.Main.class
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.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://localhost:8080/org/test/Main/class.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 9 more
Exception: java.lang.ClassNotFoundException: org.test.Main.class
هرچی هم به آدرس کلاس نگاه میکنم مشکل خاصی نمیبینم ؟
این هم عکس خطا