JSP Tutorial (vii)-pluginaction using _JSP programming

Source: Internet
Author: User
Tags comments
The Jsp:plugin Action enables you to insert the object or EMBED element of the specific browser you want to specify the plug-ins that the browser needs to run a Java applet.

Grammar:
<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 | <%= 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 Detailed:

Property usage
Type = "Bean | Applet
The type of object that the plug-in will execute. You must specify one in the bean or applet, because there is no default value for this property.
Class= "Classfilename"
The name of the Java class file that the plug-in will execute. You must include the extension in the name. And this file must be in the directory specified with the "codebase" attribute.
Codebase= "Classfiledirectoryname"
Contains a directory of Java classes that the plug-in will run or a path to this directory. The default path for this JSP file.
Name= "InstanceName"
The name of the instance of the bean or applet. Makes communication between beans or applets that are called by the same JSP file possible.
Archive = "Urltoarchive,..."
A comma-delimited list of path names. Is the pathname that contains the archive file that is preloaded with the class loader in the specified directory codebase. Typically, 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 specific elements to insert comments and some characters that are usually used as special flags. Here's a summary: grammatical purposes
<%--comment--%> a comment in jsp form. will be ignored by the Jsp-to-scriptlet compiler. Any inline JSP scripting elements,directives, or Actins, will be ignored. Cases:

<%@ page language= "java"%>






<body>




<%--This part of the comment will not be seen when viewing the source code--%>


</body>


<!--comment--> HTML-form annotations. Delivered directly to the final HTML. Any inline JSP scripting elements,directives, or Actins, will be executed normally. Cases:

<!--This page is loaded on


<%= (New Java.util.Date ()). toLocaleString ()%>-->

When you view the source code, you will see:


<!--This page is loaded on January 1,-->


<\% in template text (static HTML), write when you want to output this special symbol (<%) on the page.
%\> is used in scripting elements and is similar to the "</%" above.
\ ' In the attribute using ' ' indicates the character ' '. Of course, you can also use "" "as a distinction. Example: ' Pig ' fhjgj ', or, ' pig\ ' fhjgj\ '
\ "" In the property using "" indicates that it is a character "". Of course, you can also use "'" as a distinction. Example: "Pig ' fhjgj '", or, "pig\" fhjgj\ ""
%\> the "%>" in the attribute.
<\% the "<%" 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.