<!-- plugin.jsp -->
<%@ page contenttype="text/html; charset=gb2312"%>
<%@ page language="java" %>
<html>
<head>
<title>用<jsp:plugin>加载applet</title>
</head>
<body>
<center>
<font size = 5 color = blue>用<jsp:plugin>加载applet</font>
</center>
<br>
<hr>
<br>
<center>
<!-- 用plugin加载applet -->
<jsp:plugin type="applet" code="helloworld.class" height="40" width="320" >
<jsp:params>
<jsp:param name="name" value="jsp"/>
</jsp:params>
<!-- 如果无法载入applet时显示的信息 -->
<jsp:fallback>无法加载applet</jsp:fallback>
</jsp:plugin>
</center>
</body>
</html>
其中,helloworld.java内容如下:
import java.applet.applet;
import java.awt.graphics;
public class helloworld extends applet
{
string name;
public void init()
{
name = getparameter("name");
}
public void paint(graphics g)
{
g.drawstring(" this demo show jsp:plugin usage,the " + name + " is <br> a parameter!", 60, 25);
}
}
闽公网安备 35060202000074号