当前位置: 代码迷 >> Java Web开发 >> jsp中嵌入applet找不到种
  详细解决方案

jsp中嵌入applet找不到种

热度:57   发布时间:2016-04-17 15:10:18.0
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)
请问一下该如何解决。拜托各位大虾了~~很急,非常感谢!


------解决方案--------------------
WEB-INF下不可访问。
------解决方案--------------------
<jsp:plugin type= "applet " code= "com.model.logic.SoundCalling.class " height= "200 " width= "200 " codebase= "com.model.logic "/> 这样呢?
------解决方案--------------------