Contents | Prev | Next


<jsp:plugin>

Causes the execution of an applet or bean. The applet or bean executes in the specified plugin. If the plugin is not available, displays a dialog to initiate the download of the plugin software.

JSP Syntax

<jsp:plugin	
   type="bean|applet"	
   code="classFileName"	
   codebase="classFileDirectoryName"	
   [ name="instanceName" ]	
   [ archive="URIToArchive, ..." ]	
   [ align="bottom|top|middle|left|right" ]	
   [ height="{displayPixels |  <%= expression %>}"]	
   [ width="{displayPixels |  <%= expression %>}"]	
   [ hspace="leftRightPixels" ]	
   [ vspace="topBottomPixels" ]	
   [ jreversion="JREVersionNumber | 1.2" ]	
   [ nspluginurl="URLToPlugin" ]	
   [ iepluginurl="URLToPlugin" ] >	
	
   [ <jsp:params>	
      [ <jsp:param name="parameterName"	
         value="{parameterValue | <%= expression %>}" /> ]+	
   </jsp:params> ]	
	
   [ <jsp:fallback> text message for user </jsp:fallback> ]	
	
</jsp:plugin>

XML Syntax

<jsp:plugin	
   type="bean|applet"  code="classFileName"	
   codebase="classFileDirectoryName"	
   [ name="instanceName" ]  [ archive="URIToArchive, ..." ]	
   [ align="bottom|top|middle|left|right" ]	
   [ height="{displayPixels | %= expression %}" ]	
   [ width="{displayPixels | %= expression %}"]	
   [ hspace="leftRightPixels" ]  [ vspace="topBottomPixels" ]	
   [ jreversion="JREVersionNumber | 1.2" ]	
   [ nspluginurl="URLToPlugin" ]	
   [ iepluginurl="URLToPlugin" ]  >	
   [ <jsp:params>	
      [ <jsp:param name="parameterName"	
         value="{parameterValue | %= expression %}" /> ]+	
   </jsp:params> ]	
   [ <jsp:fallback>  text message if plugin download fails	
   </jsp:fallback>  ]	
</jsp:plugin>

Examples

<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>

Description

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 page 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.

Attributes

   width="{displayPixels |  <%= expression %>}"

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.

   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. The value must be a nonzero number. Note that hspace creates space to both the left and right and vspace creates space to both the top and bottom.

      [ <jsp:param name="parameterName"	
         value="{parameterValue | <%= expression %>}" /> ]+	
   </jsp:params>

The parameters and values that you want to pass to the applet or bean. To specify more than one parameter value, you can use more than one <jsp:param> element within the <jsp:params> element.

The 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.

If the dynamic resource you are passing the parameter to is an applet, it reads the parameter with the java.applet.Applet.getParameter method.

See Also



Contents | Prev | Next

Copyright © 2002, Sun Microsystems, Inc. All rights reserved.