初学jsp导入applet 文件出错问题!急!!!
applet 错误-------------
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%//@ page import="hello.hello" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>学习java</title>
<jsp:useBean id="hw" scope="session" class="hello.hello"></jsp:useBean>
<font color="#FF3366"><%=hw.getString()%></font>
<br>
<%hw.setString="hello word !!!"%>
<br>
<font color="#CC9966">你hao ma 吗?<%=hw.getString()%></font>
<applet code="helloworld" width="156" height="80"></applet>
真的这个applet就不可以用吗?
</body>
</html>
我的applet 文件是安装tomcat的带的,应该程序没问题,就是可能我的配置,tomcat的问题吧,说实话我真的不会配
到现在还没搞定,真的太麻烦了,都是老板急这要我把网站改版用jsp做我也没办法。哭:
我的bean文件:
import java.applet.*;
import java.awt.Graphics;
import java.awt.Font;
public class helloworld extends Applet
{
public void paint(Graphics g)
{
String s;
Font font;
s="hello world1";
font=new Font("TimesRoman",Font.BOLD,40);
g.setFont(font);
g.drawString(""+s,20,100);
}
}
我的运行错
:
载入:找不到类 helloworld。java.lang.ClassNotFoundException: helloworld 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
哭死了,到现在已经2个星期了,一点进步都没有,
连环境都弄的我晕。 请大俠们帮帮忙!!!
谢谢了。咳。。。。