简体   繁体   English

如何将Applet嵌入JSP页面?

[英]How to embed an Applet on a JSP page?

I have my applet in a Package called "AppletTabla", the class name is "AppTabla" 我的小程序放在名为“ AppletTabla”的程序包中,类名称为“ AppTabla”

I'm using this code to embed it to the JSP page, but I always get an "ClassNotFoundException" when I run the JSP. 我正在使用此代码将其嵌入到JSP页面,但是在运行JSP时始终会收到“ ClassNotFoundException”。

<APPLET CODE = "AppTabla.class"
        CODEBASE="AppletTabla/"
               WIDTH = "400"
               HEIGHT = "550"
               ALIGN= "BOTTOM"
></APPLET> 

Also, I've trying to run some examples from different pages, but I keep getting the "NoClassDefFoundError". 另外,我尝试从不同的页面运行一些示例,但是我不断收到“ NoClassDefFoundError”。

You are specifying a relative URL to codebase , which means that if your JSP is at " http://www.domain.com/some/path/page.jsp ", the applet is expected to be at " http://www.domain.com/some/path/AppletTabla/AppTabla.class ". 您正在指定codebase的相对URL,这意味着,如果您的JSP位于“ http://www.domain.com/some/path/page.jsp ”,则该小程序应位于“ http:// www” .domain.com / some / path / AppletTabla / AppTabla.class “。

Try specifying an absolute path for codebase , eg "/AppletTabla/" or wherever it is. 尝试为codebase指定绝对路径,例如“ / AppletTabla /”或任何位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM