Purpose of tag(a) used to incorporate Java applets into a Web page. (b) Downloads a plugin to the client Web browser to execute an applet or Bean. (c) Both (a) & (b)

(c)

EXPLANATION:

JSP Syntax :

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

[
[ ]+
]

[ text message for user ]




Description :
The tag is replaced by either an or tag, whichever is most appropriate for the client Web browser (the tag is for browsers that use HTML 4.0).

The element sends parameter names and values to an applet or Bean at startup. The 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 tag takes most of its attributes from the HTML and tags ( is defined in HTML 3.2 and 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/REChtml32.html
For HTML 4.0: http://www.w3.org/TR/REChtml40/

Attributes :

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.

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.

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

archive="URIToArchive, ..."

A commaseparated 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.

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

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.

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.

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.

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.

[ ]+

The parameters and values that you want to pass to the applet or Bean. To specify more than one name and value, use multiple tags within the element. Applets read parameters with the java.applet.Applet.getParameter method.

text message for user

A text message to display for the user if the plugin cannot be started.

Example:

The directive takes care of generating all the HTML code necessary to embed and activate a Java applet.
Consider the following example:










Oops! Something bad happened and I can't display this applet






The code above sets up the applet contained in "NewsTicker.class", and passes it a bunch of namevalue pairs of parameters. The tag is used to pass these parameters to the applet, while the directive contains error text, in the event that the applet cannot be found or displayed.

When JSP compiles and renders the page, the code above is automatically converted to its HTML equivalent.












<br> Oops! Something bad happened and I can't display this applet <br>






 

This Question is not yet answered!

 
 

Related Answered Questions

 

Related Open Questions

 
 

 

It looks like you are using an AD Blocker!

 

 

Please Turn OFF your ad blocker

- OR -

LOGIN to continue using GeekInterview website.

 

 

 

Disable
Ad Blocker

 

Learn More

Login
GeekInterview

 

Login

Create your
GeekInterview account

 

Signup

Continue Reading after Disabling

 

Refresh