⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jspintro12.html

📁 j2eePDF格式的电子书
💻 HTML
字号:
<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">  <head>    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />    <meta http-equiv="Content-Style-Type" content="text/css" />    <title>Including an Applet</title>    <link rel="StyleSheet" href="document.css" type="text/css" media="all" />    <link rel="StyleSheet" href="catalog.css" type="text/css" media="all" />    <link rel="Table of Contents" href="J2EETutorialTOC.html" />    <link rel="Previous" href="JSPIntro11.html" />    <link rel="Next" href="JSPIntro13.html" />    <link rel="Index" href="J2EETutorialIX.html" />  </head>  <body>    <table width="550" summary="layout" id="SummaryNotReq1">      <tr>	<td align="left" valign="center">	<font size="-1">	<a href="http://java.sun.com/j2ee/1.4/download.html#tutorial" target="_blank">Download</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/faq.html" target="_blank">FAQ</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/history.html" target="_blank">History</a>	</td>        <td align="center" valign="center"><a accesskey="p" href="JSPIntro11.html"><img id="LongDescNotReq1" src="images/PrevArrow.gif" width="26" height="26" border="0" alt="Prev" /></a><a accesskey="c" href="J2EETutorialFront.html"><img id="LongDescNotReq1" src="images/UpArrow.gif" width="26" height="26" border="0" alt="Home" /></a><a accesskey="n" href="JSPIntro13.html"><img id="LongDescNotReq3" src="images/NextArrow.gif" width="26" height="26" border="0" alt="Next" /></a><a accesskey="i" href="J2EETutorialIX.html"></a>        </td>	<td align="right" valign="center">	<font size="-1">	<a href="http://java.sun.com/j2ee/1.4/docs/api/index.html" target="_blank">API</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/search.html" target="_blank">Search</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/sendusmail.html" target="_blank">Feedback</a></font>	</font>	</td>      </tr>    </table>    <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider">    <blockquote><a name="wp66270"> </a><h2 class="pHeading1">Including an Applet</h2><a name="wp66272"> </a><p class="pBody">You can include an applet or JavaBeans component in a JSP page by using the <code class="cCode">jsp:plugin</code> element. This element generates HTML that contains the appropriate client-browser-dependent constructs (<code class="cCode">&lt;object&gt;</code> or <code class="cCode">&lt;embed&gt;</code>) that will result in the download of the Java Plug-in software (if required) and client-side component and subsequent execution of any client-side component. The syntax for the <code class="cCode">jsp:plugin</code> element is as follows:</p><div class="pPreformattedRelative"><pre class="pPreformattedRelative">&lt;jsp:plugin &nbsp;&nbsp;type=&quot;bean|applet&quot; &nbsp;&nbsp;code=&quot;<code class="cVariable">objectCode</code>&quot; &nbsp;&nbsp;codebase=&quot;<code class="cVariable">objectCodebase</code>&quot; &nbsp;&nbsp;{ align=&quot;<code class="cVariable">alignment</code>&quot; } &nbsp;&nbsp;{ archive=&quot;<code class="cVariable">archiveList</code>&quot; } &nbsp;&nbsp;{ height=&quot;<code class="cVariable">height</code>&quot; } &nbsp;&nbsp;{ hspace=&quot;<code class="cVariable">hspace</code>&quot; } &nbsp;&nbsp;{ jreversion=&quot;<code class="cVariable">jreversion</code>&quot; } &nbsp;&nbsp;{ name=&quot;<code class="cVariable">componentName</code>&quot; } &nbsp;&nbsp;{ vspace=&quot;<code class="cVariable">vspace</code>&quot; } &nbsp;&nbsp;{ width=&quot;<code class="cVariable">width</code>&quot; } &nbsp;&nbsp;{ nspluginurl=&quot;<code class="cVariable">url</code>&quot; } &nbsp;&nbsp;{ iepluginurl=&quot;<code class="cVariable">url</code>&quot; } &gt; &nbsp;&nbsp;{ &lt;jsp:params&gt; &nbsp;&nbsp;&nbsp;&nbsp;{ &lt;jsp:param name=&quot;<code class="cVariable">paramName</code>&quot; value= <code class="cVariable">paramValue</code>&quot; /&gt; }+&nbsp;&nbsp;&lt;/jsp:params&gt; } &nbsp;&nbsp;{ &lt;jsp:fallback&gt; <code class="cVariable">arbitrary_text</code> &lt;/jsp:fallback&gt; } &lt;/jsp:plugin&gt;<a name="wp66274"> </a></pre></div><a name="wp66275"> </a><p class="pBody">The <code class="cCode">jsp:plugin</code> tag is replaced by either an <code class="cCode">&lt;object&gt;</code> or <code class="cCode">&lt;embed&gt;</code> tag as appropriate for the requesting client. The attributes of the <code class="cCode">jsp:plugin</code> tag provide configuration data for the presentation of the element as well as the version of the plug-in required. The <code class="cCode">nspluginurl</code> and <code class="cCode">iepluginurl</code> attributes override the default URL where the plug-in can be downloaded.</p><a name="wp66277"> </a><p class="pBody">The <code class="cCode">jsp:params</code> element specifies parameters to the applet or JavaBeans component. The <code class="cCode">jsp:fallback</code> element indicates the content to be used by the client browser if the plug-in cannot be started (either because <code class="cCode">&lt;object&gt;</code> or <code class="cCode">&lt;embed&gt;</code> is not supported by the client or because of some other problem). </p><a name="wp66279"> </a><p class="pBody">If the plug-in can start but the applet or JavaBeans component cannot be found or started, a plug-in-specific message will be presented to the user, most likely a pop-up window reporting a <code class="cCode">ClassNotFoundException</code>.</p><a name="wp66281"> </a><p class="pBody">The Duke's Bookstore page <code class="cCode"><a  href="../examples/web/bookstore2/web/template/prelude.txt" target="_blank">/template/prelude.jspf</a></code> creates the banner that displays a dynamic digital clock generated by <code class="cCode">DigitalClock</code>:</p><a name="wp66285"> </a><p class="pBody"></p><div align="left"><img src="images/Fig293.gif" height="375" width="399" alt="Duke's Bookstore with Applet" border="0" hspace="0" vspace="0"/></div><p class="pBody"></p><p>  <a name="66286"> </a><strong><font >Figure 12-3    Duke's Bookstore with Applet</font></strong></p><a name="wp66287"> </a><p class="pBody">The <code class="cCode">jsp:plugin</code> element used to download the applet follows:</p><div class="pPreformattedRelative"><pre class="pPreformattedRelative">&lt;jsp:plugin &nbsp;&nbsp;type=&quot;applet&quot; &nbsp;&nbsp;code=&quot;DigitalClock.class&quot; &nbsp;&nbsp;codebase=&quot;/bookstore2&quot; &nbsp;&nbsp;jreversion=&quot;1.4&quot; &nbsp;&nbsp;align=&quot;center&quot; height=&quot;25&quot; width=&quot;300&quot;&nbsp;&nbsp;nspluginurl=&quot;http://java.sun.com/j2se/1.4.2/download.html&quot; &nbsp;&nbsp;iepluginurl=&quot;http://java.sun.com/j2se/1.4.2/download.html&quot; &gt;&nbsp;&nbsp;&lt;jsp:params&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;jsp:param name=&quot;language&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value=&quot;${pageContext.request.locale.language}&quot; /&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;jsp:param name=&quot;country&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value=&quot;${pageContext.request.locale.country}&quot; /&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;jsp:param name=&quot;bgcolor&quot; value=&quot;FFFFFF&quot; /&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;jsp:param name=&quot;fgcolor&quot; value=&quot;CC0066&quot; /&gt;&nbsp;&nbsp;&lt;/jsp:params&gt;&nbsp;&nbsp;&lt;jsp:fallback&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Unable to start plugin.&lt;/p&gt;&nbsp;&nbsp;&lt;/jsp:fallback&gt;&lt;/jsp:plugin&gt;<a name="wp66288"> </a></pre></div>    </blockquote>   <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider">    <table width="550" summary="layout" id="SummaryNotReq1">      <tr>	<td align="left" valign="center">	<font size="-1">	<a href="http://java.sun.com/j2ee/1.4/download.html#tutorial" target="_blank">Download</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/faq.html" target="_blank">FAQ</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/history.html" target="_blank">History</a>	</td>        <td align="center" valign="center"><a accesskey="p" href="JSPIntro11.html"><img id="LongDescNotReq1" src="images/PrevArrow.gif" width="26" height="26" border="0" alt="Prev" /></a><a accesskey="c" href="J2EETutorialFront.html"><img id="LongDescNotReq1" src="images/UpArrow.gif" width="26" height="26" border="0" alt="Home" /></a><a accesskey="n" href="JSPIntro13.html"><img id="LongDescNotReq3" src="images/NextArrow.gif" width="26" height="26" border="0" alt="Next" /></a><a accesskey="i" href="J2EETutorialIX.html"></a>        </td>	<td align="right" valign="center">	<font size="-1">	<a href="http://java.sun.com/j2ee/1.4/docs/api/index.html" target="_blank">API</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/search.html" target="_blank">Search</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/sendusmail.html" target="_blank">Feedback</a></font>	</font>	</td>      </tr>    </table>    <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider"><p><font size="-1">All of the material in <em>The J2EE(TM) 1.4 Tutorial</em> is <a href="J2EETutorialFront2.html">copyright</a>-protected and may not be published in other workswithout express written permission from Sun Microsystems.</font>  </body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -