Questions:Ask|Latest

 
 

Share on Google+Share on Google+

JSP Plugin

Advertisement
The is used to display an object, especially an applet or a Bean on the client browser.

JSP Plugin

        

Syntax: <jsp: plugin type = "bean |applet" code = "ClassFileName" codeBase = "ClassFileDirectoryName">

The <jsp:plugin> is used to display an object, especially an applet or a Bean on the client browser. When the Jsp file is translated and compiled, the <jsp:plugin> is replaced by either an <object> or <embed> element, it is based on the browser version. 

Some of the attributes of <jsp: plugin> are defined below:

type = "bean |applet" :- This type of object will be executed by the plug-in. It must be either bean or an applet.

code = "ClassFileName" :- It is the name of the java class file which will be executed by the plug-in. The use .class extension is a must.

codebase = "ClassFileDirectoryName" :- It is the name of the directory that contains the java class file, that will be executed by the plug-in.

The code of the program is given below:

 

import java.applet.*;
import java.awt.*;
      
//<applet code = JavaApplet width = 300 height = 300></applet>
public class JavaApplet extends Applet{
  public void paint(Graphics g){
    g.drawString("Welcome in Java Applet.",40,20);
  }
}

 

<jsp:plugin type="applet" code="JavaApplet" codebase=
 "/tapan/jsp/jspexamples" width = "200" height = "200">
	<jsp:fallback>
		<p>Unable to load applet</p>
	</jsp:fallback>
</jsp:plugin>

The output of the program is given below:

Download this example.

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: February 11, 2008

Related Tutorials

Ask Questions?    Discuss: JSP Plugin   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com