JSP tutorial (7)-Use of pluginaction

Source: Internet
Author: User

JSP: plugin action enables you to insert the object or EMBED element of a specific browser to specify the plug-in required for the browser to run a Java applet.

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 = "Maid number | 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>
Attribute details:

Attribute usage
Type = "bean | applet"
Type of the object to be executed by the plug-in. You must specify one in bean or applet because there is no default value for this attribute.
Class = "classfilename"
Name of the Java class file to be executed by the plug-in. The name must contain the extension. The file must be in the directory specified by the "codebase" attribute.
Codebase = "classfiledirectoryname"
Contains the directory of the Java class that the plug-in runs or points to the path of this directory. The path of the JSP file by default.
Name = "InstanceName"
The name of the bean or applet instance. This makes communication between beans or applets called by the same JSP file possible.
Archive = "urltoarchive ,..."
List of path names separated by commas. Is the path name of the archive file pre-loaded by the class loader under the directory specified by codebase. Generally, these archive files are securely loaded through the network, which can significantly improve the performance of the applet.
Comments and character reference habits

You can use some specific elements to insert comments and some characters that are usually used as special symbols. The following is a summary: syntax Purpose
<% -- Comment -- %> A comment in JSP format. Will be ignored by the JSP-to-scriptlet compiler. Any embedded JSP scripting elements, ctictives, or actins will be ignored. Example:

<% @ Page Language = "Java" %>

<HTML>

<Head> <title> A comment test </title>

<Body>

<H2> A test of comments </H2>

<% -- This part of comments will not be viewedSource code-- %>

</Body>
</Html>

<! -- Annotation --> HTML annotation. Directly to the final HTML. Any embedded JSP scripting elements, directives, or actins will be executed normally. Example:

<! -- This page was loaded on

<% = (New java. util. Date (). tolocalestring () %> -->

View SourceCodeYou will see:

<! -- This page was loaded on January 1, 2000 -->

<\ % In template text (static html), please write this special symbol (<%) on the page.
% \> Used in scripting elements, which is similar to the preceding "</%.
\ 'Indicates the character "'" In the attribute where "'" is used. Of course, you can also use "" to differentiate. Example: 'pig "fhjgj" ', or, 'pig \ 'fhjgj \''
\ "Indicates the character" "in the" "attribute used. Of course, you can also use "'" to differentiate. Example: "pig 'fhjgj'", or, "pig \" fhjgj \""
% \> "%>" In the property ".
<\ % "In the attribute ".

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.