个性化阅读
专注于IT技术分析

在JSP中显示小程序(jsp:plugin操作标记)

jsp:plugin操作标记用于将小程序嵌入jsp文件中。 jsp:plugin操作标记在客户端下载插件以执行applet或bean。

jsp:plugin操作标记的语法

<jsp:plugin type= "applet | bean" code= "nameOfClassFile" 
codebase= "directoryNameOfClassFile"
</jsp:plugin>

在JSP中显示小程序的示例

在此示例中, 我们仅使用jsp:plugin标记在jsp中显示applet。 jsp文件所在的当前文件夹中必须具有MouseDrag.class文件(一个applet类文件)。你可以简单地下载包含index.jsp, MouseDrag.java和MouseDrag.class文件的程序来运行此应用程序。

index.jsp

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Mouse Drag</title>
    </head>
    <body bgcolor="khaki">
<h1>Mouse Drag Example</h1>

 <jsp:plugin align="middle" height="500" width="500"
     type="applet"  code="MouseDrag.class" name="clock" codebase="."/>

    </body>
</html>
赞(0)
未经允许不得转载:srcmini » 在JSP中显示小程序(jsp:plugin操作标记)

评论 抢沙发

评论前必须登录!