日期:2014-05-18  浏览次数:20816 次

jsp中嵌入applet找不到类
各位,本人的问题具体是这样的:
我用的是eclipse+tomcat
jsp页面与applet的class文件的路径关系是这样的:
-工程名/src/com/model/logic/SoundCalling.java(applet路径)
-工程名/WebRoot/jsp页面
-工程名/WEB-INF/classes/com/model/logic/SoundCalling.class

我的jsp页面中用下面两种方法来写都不行,都会报错,说找不到类:
<jsp:plugin   type= "applet "   code= "WEB-INF.classes.com.model.logic.SoundCalling.class "   height= "200 "   width= "200 "/>      
<jsp:plugin   type= "applet "   code= "com.model.logic.SoundCalling.class "   height= "200 "   width= "200 "   codebase= "WEB-INF/classes "/>  


报错信息:    
载入:找不到类   WEB-INF.classes.com.model.logic.SoundCalling.class。
java.lang.ClassNotFoundException:   WEB-INF.classes.com.model.logic.SoundCalling.class
at   sun.applet.AppletClassLoader.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)
Caused   by:   java.io.IOException:   open   HTTP   connection   failed.
at   sun.applet.AppletClassLoader.getBytes(Unknown   Source)
at   sun.applet.AppletClassLoader.access$100(Unknown   Source)
at   sun.applet.AppletClassLoader$1.run(Unknown   Source)
at   java.security.AccessController.doPrivileged(Native   Method)
...   10   more
Exception   in   thread   "Thread-8 "   java.lang.NullPointerException
at   sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown   Source)
at   sun.plugin.AppletViewer.showAppletException(Unknown   Source)
at   sun.applet.AppletPanel.runLoader(Unknown   Source)
at   sun.applet.AppletPanel.run(Unknown   Source)
at   java.lang.Thread.run(Unknown   Source)
java.lang.NullPointerException
at   sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown   Source)
at   sun.plugin.AppletViewer.showAppletStatus(Unknown   Source)
at   sun.applet.AppletPanel.run(Unknown   Source)
at   java.lang.Thread.run(Unknown   Source)
Exception   in   thread   "thread   applet-WEB-INF.classes.com.model.logic.SoundCalling.class "   java.lang.NullPointerException
at   sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown   Source)
at   sun.plugin.AppletViewer.showAppletException(Unknown   Source)
at   sun.applet.AppletPanel.run(Unknown   Source)
at   java.lang.Thread.run(Unknown   Source)


(注:浏览器上面的设置也没问题,选定了applet项:1.5.0_06jre用于applet)
请问一下该如何解决。拜托各位大虾了~~很急,非常感谢!


MVC中Action回发中显示的乱码有关问题,以前解决过乱码,但这次.请大家来帮忙看看代码,这是咋回事