Downloads a plugin to the client Web browser to execute an applet or Bean.
<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" value="
parameterValue" /> ]+
</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>
tag is replaced by either an <object>
or <embed>
tag, whichever is most appropriate for the client Web browser (the <object>
tag is for browsers that use HTML 4.0).
The <jsp:params>
element sends parameter names and values to an applet or Bean at startup. The <jsp:fallback>
element provides a message for the user if the plugin does not start. If the plugin starts but the applet or Bean does not, the plugin usually displays a popup window explaining the error to the user.
The <jsp:plugin>
tag takes most of its attributes from the HTML <applet>
and <object>
tags (<applet>
is defined in HTML 3.2 and <object>
in HTML 4.0). You may want to refer to the official HTML specifications in which these tags are introduced:
type="bean|applet"
The type of object the plugin will execute. You must specify either bean
or applet
, as this attribute has no default value.
code="
classFileName"
The name of the Java class file that the plugin will execute. You must include the .class extension in the name following code
. The filename is relative to the directory named in the codebase
attribute.
codebase="
classFileDirectoryName"
The absolute or relative path to the directory that contains the applet's code. If you do not supply a value, the path of the JSP file that calls <jsp:plugin>
is used.
name="
instanceName"
A name for the Bean or applet instance, which makes it possible for applets or Beans called by the same JSP file to communicate with each other.
archive="
URIToArchive, ..."
A comma-separated list of paths that locate archive files to be preloaded with a class loader located in the directory named in codebase
. The archive files are loaded securely, often over a network, and typically improve the applet's performance.
align="
bottom|top|middle|left|right"
The positioning of the image displayed by the applet or Bean relative to the line in the JSP result page that corresponds to the line in the JSP file containing the <jsp:plugin>
tag. The results of the different values 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"
The initial height and width, in pixels, of the image the applet or Bean displays, not counting any windows or dialog boxes the applet or Bean brings up.
hspace="
leftRightPixels" vspace="
topBottomPixels"
The amount of space, in pixels, to the left and right (or top and bottom) of the image the applet or Bean displays. Must be a small nonzero number.
jreversion="
JREVersionNumber|
1.1"
The version of the Java Runtime Environment (JRE) the applet or Bean requires. The default value is 1.1.
nspluginurl="
URLToPlugin"
The URL where the user can download the JRE plugin for Netscape Navigator. The value is a full URL, with a protocol name, optional port number, and domain name.
iepluginurl="
URLToPlugin"
The URL where the user can download the JRE plugin for Internet Explorer. The value is a full URL, with a protocol name, optional port number, and domain name.
<jsp:params> [ <jsp:param name="
parameterName" value="
parameterValue" /> ]+ </jsp:params>
The parameters and values that you want to pass to the applet or Bean. To specify more than one name and value, use multiple <jsp:param>
tags within the <jsp:params>
element. Applets read parameters with the java.applet.Applet.getParameter
method.
<jsp:fallback>
text message for user </jsp:fallback>
A text message to display for the user if the plugin cannot be started.