Executes an applet or bean and, if necessary, downloads a Java plug-in to execute it.
<jsp:plugin
type="bean|applet"
code="classFileName"
codebase="classFileDirectoryName"
[ name="instanceName" ]
[ archive="URIToArchive, ..." ]
[ align="bottom|top|middle|left|right" ]
[ height="displayPixels" ]
[ width="displayPixels" ]
[ hspace="leftRightPixels" ]
[ vspace="topBottomPixels" ]
[ jreversion="JREVersionNumber|1.1" ]
[ nspluginurl="URLToPlugin" ]
[ iepluginurl="URLToPlugin" ] >
[ <jsp:params>
[ <jsp:param name="parameterName"parameterValue
value="{| <%=expression%>}" /> ]+
</jsp:params> ]
[ <jsp:fallback>text message for user</jsp:fallback> ]
</jsp:plugin>
<jsp:plugin type=applet code="Molecule.class" codebase="/html">
<jsp:params>
<jsp:param name="molecule" value="molecules/benzene.mol" />
</jsp:params>
<jsp:fallback>
<p>Unable to load applet</p>
</jsp:fallback>
</jsp:plugin>
The <jsp:plugin> element plays or dispays an object (typically an applet or bean) in the client Web browser, using a Java plug-in that is built in to the browser or downloaded from a specified URL.
When the JSP file is translated and compiled and Java and sends back an HTML response to the client, the <jsp:plugin> element is replaced by either an <object> or <embed> element, according to the browser version. The <object> element is defined in HTML 4.0 and <embed> in HTML 3.2.
In general, the attributes to the <jsp:plugin> element specify whether the object is a bean or an applet, locate the code that will be run, position the object in the browser window, specify an URL from which to download the plug-in software, and pass parameter names and values to the object. The attributes are described in detail in the next section.
type="bean|applet"
bean or applet, as this attribute has no default value.
code="classFileName"
.class extension in the name. The file you specify should be in the directory named in the codebase attribute.
codebase="classFileDirectoryName"
<jsp:plugin> is used.
name="instanceName"
archive="URIToArchive, ..."
codebase. The archive files are loaded securely, often over a network, and typically improve the applet's performance.
align="bottom|top|middle|left|right"
<jsp:plugin> element appears. The allowed values for align are listed below:
bottom Aligns the bottom of the image with the baseline of the text line.
top Aligns the top of the image with the top of the text line.
middle Aligns the vertical center of the image with the baseline of the text line.
left Floats the image to the left margin and flows text along the image's right side.
right Floats the image to the right margin and flows text along the image's left side.
height="displayPixels"
width="displayPixels"
hspace="leftRightPixels"
vspace="topBottomPixels"
jreversion="JREVersionNumber|1.1"
nspluginurl="URLToPlugin"
iepluginurl="URLToPlugin"
<jsp:params>
[ <jsp:param name="parameterName"
value="{parameterValue | <%= expression %>}" /> ]+
</jsp:params>
<jsp:param> element within the <jsp:params> element.
name attribute specifies the parameter name and takes a case-sensitive literal string. The value attribute specifies the parameter value and takes either a case-sensitive literal string or an expression that is evaluated at runtime.
java.applet.Applet.getParameter method.
<jsp:fallback> text message for user </jsp:fallback>