JSP Syntax (12)

Source: Internet
Author: User
Tags expression
js| Grammar <jsp:plugin>

Execute an applet or bean and, if possible, download a Java plug-in to execute it.



JSP syntax

<jsp:plugin

Type= "Bean | Applet

Code= "Classfilename"

Codebase= "Classfiledirectoryname"

[Name= "InstanceName"]

[archive= "uritoarchive, ..."]

[align= "bottom | top | middle |

[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:fallback> text message for user </jsp:fallback>]



</jsp:plugin>



Example

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

Describe

The <jsp:plugin> element is used to play or display an object in the browser (typically applets and beans), and this display needs to be in the browser's Java plugin.



When a JSP file is compiled, the,<jsp:plugin> element will be replaced with a <object> or <embed> element according to the browser version when sent to the browser. Note that,<object> is used for HTML 4.0,<embed> for HTML 3.2.



In general, the,<jsp:plugin> element specifies whether the object is an applet or a bean, and also specifies the name of the class, as well as the location, and also specifies where the Java plug-in will be downloaded. Specifically as follows:



Property

Type= "Bean | Applet

. The type of plug-in object that will be executed, you must specify whether this is a bean or an applet, because this property has no default value.



Code= "Classfilename"

The name of the Java class that will be executed by the Java plug-in, which must end with. class. This file must exist in the directory specified by the CODEBASE property.



Codebase= "Classfiledirectoryname"

The directory (or path) of the Java class file that will be executed, and if you do not provide this attribute, the directory using the <jsp:plugin> JSP file will be used.



Name= "InstanceName"

The name of this bean or applet instance, which will be invoked elsewhere in the JSP.



Archive= "uritoarchive, ..."

Some path names separated by commas that are used to preinstall some of the class that will be used, which improves the performance of the applet.



align= "Bottom | Top | Middle | Left | Right

The position of the graphic, object, applet, with the following values:



Bottom

Top

Middle

Left

Right

height= "Displaypixels" width= "Displaypixels"

The long, wide value that the applet or bean will display, which is a number, in pixels.



Hspace= "Leftrightpixels" vspace= "Topbottompixels"

The amount of space, in pixels, required to be left on or off the screen when the applet or bean is displayed.



jreversion= "Jreversionnumber | 1.1 "

The version of the Java Runtime Environment (JRE) required to run the applet or the bean. The default value is 1.1.



Nspluginurl= "Urltoplugin"

Netscape Navigator user can use the JRE download address, this value is a standard URL, such as http://www.aspcn.com/jsp



Iepluginurl= "Urltoplugin"

IE users can use the JRE download address, this value is a standard URL, such as http://www.aspcn.com/jsp



 



<jsp:params> [<jsp:param name= "parametername" value= "{parametervalue | <%= expression%>}"/>]+ </ Jsp:params>

The parameter or parameter value you need to pass to the applet or bean.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.