我用的是MyEclispe6.5,写了一个applet程序,在Eclispe里面运行了下有效果,没有错误.我又写了个jsp文件,出了这样的异常
:Java(TM) Plug-in: Version 1.2.2_017Using JRE version 1.2.2User home directory = C:\Documents and Settings\cProxy Configuration: no proxyJAR cache enabled.Opening http://localhost:8080/S2Project/MyApplet.classCacheHandler file name: nullConnecting http://localhost:8080/S2Project/MyApplet.class with no proxyOpening http://localhost:8080/S2Project/MyApplet.class with cookie "JSESSIONID=FCEC2D6CE6D7D09DC63C37C99D8B6337".Opening http://localhost:8080/S2Project/MyApplet/class.classCacheHandler file name: nullConnecting http://localhost:8080/S2Project/MyApplet/class.class with no proxyOpening http://localhost:8080/S2Project/MyApplet/class.class with cookie "JSESSIONID=FCEC2D6CE6D7D09DC63C37C99D8B6337".load: class MyApplet.class not found.java.lang.ClassNotFoundException: java.io.FileNotFoundException: http://localhost:8080/S2Project/MyApplet/class.class at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source) at java.net.HttpURLConnection.getResponseCode(Unknown Source) at sun.applet.AppletClassLoader.getBytes(Unknown Source) at sun.applet.AppletClassLoader.access$1(Unknown Source) at sun.applet.AppletClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.applet.AppletClassLoader.findClass(Unknown Source) at sun.plugin.security.PluginClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadCode(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.plugin.AppletViewer.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
我的JSP文件为:<body>
     <jsp:plugin code="MyApplet.class" codebase="." type="applet"></jsp:plugin><!--applet的class文件与JSP文件在同一个目录下-->
</body>