DoneJSP plugin 一个不运行不成功的实例
当运行usingPlugin.jsp,总是提示我保存,却不出现书上的效果,为什么?usingPlugin.jsp
<%@page contentType="text/html charset=gbk2312"%>
<%@page pageEncoding="gb2312"%>
<html>
<title>演示 plugin</title>
<body>
<jsp:plugin codebase="/html" type = "applet" code = "showmsg.class" height = "200" width = "200">
<jsp:params>
<jsp:param name = "msg1" value = "C++"/>
<jsp:param name = "msg2" value = "Java"/>
<jsp:param name = "msg3" value = "C#"/>
</jsp:params>
</jsp:plugin>
</body>
</html>
showmsg.java
import java.awt.*;
import java.applet.*;
public class showmsg extends Applet
{
String msg1,msg2,msg3;
public void init()
{
msg1 = getParameter("msg1");
msg2 = getParameter("msg2");
msg3 = getParameter("msg3");
}
public void paint(Graphics g)
{
Font font = new Font("SansSerif",Font.BOLD,30);
g.setFont(font);
g.setColor(Color.blue);
g.drawString(msg1,20,40);
g.drawString(msg2,20,70);
g.drawString(msg3,20,100);
}
}
showmsg.class 见附件
[[it] 本帖最后由 zzxwill 于 2008-6-7 13:30 编辑 [/it]]
showmsg.rar
(941 Bytes)