Displaying keyword search results 1 - 3
Created by Fang on April 01, 2010 22:24:58 Last update: April 02, 2010 02:49:38
In this note I'll show you how to create and package a JSP custom tag. The purpose of this tag is to display a random splash image for a home page, among a set of images. We should be able to add or delete candidate splash images from the WAR archive without the need to change the JSP. This is the intended use of the tag:
<%@ taglib uri="http://custom.tag.com/demo" prefix...In the above example you provide a set of images named splash*.png (e.g., splash1.png, spalsh2.png, ...), and the tag will pick a random one to display when the JSP is rendered. Let's get started. I'll use Maven for this purpose. Create the standard Maven directory structure
./pom.xml ./src ./src/main ./src/main/jav...pom.xml
package tagdemo; import java.util.ArrayList......
Created by Dr. Xi on January 29, 2009 21:33:44 Last update: January 30, 2009 17:43:33
You can use applet , object , or embed tags to embed an applet in your HTML page. However, The applet tag is interpreted by both IE and Mozilla family of browsers. The applet tag won't automatically download a JRE if the Java Plug-in isn't already installed. The object tag works only for IE The embed tag works only for Mozilla family of browsers, i.e., Firefox. Use applet tag:
<applet code="MyApplet.class" width="200" ...Use object tag:
<!-- latest JRE --> <OBJECT classid="clsid:...Use embed tag:
<!-- highest JRE that supports MIME type ...Mixed object and embed tag:
<object classid="clsid:8AD9C840-044E-11D1-B3E9...You need to use a different name for the Mozilla embed tag and use that name to refer to the applet...
Created by Dr. Xi on January 30, 2009 16:57:12 Last update: January 30, 2009 17:25:36
The scriptable attribute defaults to false . However, even when you set it to true , there is a time delay between when the applet is loaded and when it becomes scriptable . The following code may fail: