在线等十万火急,applet在本地打开可以使用,在服务器使用不了
----------------testapplet.htm---------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<applet name="testApplet" code="test.TestApplet.class" codebase = "." width="32" height="32">
</applet>
<script language="JavaScript" type="text/JavaScript">
alert("haha");
alert(window.document.testApplet.getStr());
</script>
</body>
</html>
------------- TestApplet.java -----------------
package applets;
import java.applet.Applet;
import java.util.*;
import java.math.BigDecimal;;
public class TestApplet extends Applet {
/**
*
*/
private static final long serialVersionUID = 1L;
public HashMap getHashMap()
{
HashMap hm = new HashMap();
hm.put("NAME", "myname is jim");
hm.put("VAL", new BigDecimal(999));
return hm;
}
public String getStr()
{
return "8888";
}
}
----------------------------------------------------
testapplet.htm同级目录下有文件夹applets,TestApplet放在其中
服务器:tomcat5.5