BBS水木清华站∶精华区

发信人: agents (智能代理), 信区: Java        
标  题: JSP语法(12) 
发信站: BBS 水木清华站 (Tue Jan  2 14:52:39 2001) 
 
【<jsp:plugin>】   
 
 Downloads a Java plugin to the client Web browser to execute an applet or  
 Bean. 
 
▲[JSP Syntax] 
 
<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> 
 
▲[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> tag is replaced by either an <object> or <embed> tag, which 
 ever 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: 
  For HTML 3.2: http://www.w3.org/TR/REC-html32.html 
  For HTML 4.0: http://www.w3.org/TR/REC-html40/ 
 
▲[Attributes] 
 
 (1) 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. 
  
 (2)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. 
 
 (3)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. 
 
(4) 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. 
 
(5)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. 
 
(6)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. 
 
(7)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. 
 
(8)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. 
 
 
(9)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. 
 
-- 
 
※ 修改:·agents 於 Jan  2 17:14:13 修改本文·[FROM:   166.111.54.22] 
※ 来源:·BBS 水木清华站 smth.org·[FROM: 166.111.54.22] 

BBS水木清华站∶精华区