jsp:plugin问题
时间:2008-05-10 10:55:50
来源:论坛整理 作者: 编辑:chinaitzhe
我的Applet的java文件如下
package com.jspdev.ch3;
import javax.swing.*;
import java.awt.*;
public class MyApplet extends JApplet
{
String img;
public void paint(Graphics g)
{
Image image = getImage(getCodeBase(),img);
g.drawImage(image,0,0,400,400,this);
g.setColor(Color.blue);
g.setFont(new Font("宋体",2,24));
g.drawString("使用JSP:PLUGIN在JSP中添加applet",40,170);
g.setFont(new Font("NewsRoman",2,10));
g.setColor(Color.prink);
g.drawString(new java.util.Date().toString(),10,190);
}
public void init()
{
img = getParameter("image");
}
}
plugin.jsp
<%@ page language="java" contentType="text/html;charset=GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() "://" request.getServerName() ":" request.getServerPort() path "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href=" <%=basePath%>">
<title>No Document </title>
<meta http-equiv="pragma" content="no-cache">
.............................................
</head>
<body>
<hr> <br>
<jsp:plugin code="com.jspdev.ch3.MyApplet" codebase="." type="applet"
align="center" width="400" height="200">
<jsp:params>
<jsp:param name="image" value="pic.jpg"/>
</jsp:params>
<jsp:fallback>在插入Applet时产生错误 </jsp:fallback>
</jsp:plugin>
</body>
</html>
说明我的pic.jpg图片在webRoot目录下.可是我运行plugin.jsp的时候什么也没有显示出来,只是把 <hr>显示出来了,也就是说只显示了一条横线.希望各位高手解答一下,谢了
网友回复:不会jsp:plugin这个标签
没用过
关键字:jsp,plugin,问题,
下一篇:下面没有链接了











文章评论
共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面