Displaying keyword search results 1 - 8
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 September 01, 2008 02:19:31 Last update: May 23, 2009 16:50:10
Use this bookmarklet to set or delete cookies in a web page. If you leave the expires date as is, the cookie will be deleted. Add this link to your bookmarks to install the bookmarklet.
Created by Dr. Xi on March 02, 2009 23:29:08 Last update: March 28, 2009 21:35:41
An HTML form contains more than what meets the eye. This bookmarklet displays information about form fields in the page. When there are multiple forms on the page, successive invocations of the bookmarklet display each form in turn. Add this link to your bookmarks. Here's the code:
Created by Dr. Xi on August 28, 2008 22:52:01 Last update: March 28, 2009 16:50:42
Created by Dr. Xi on September 01, 2008 01:01:59 Last update: September 02, 2008 15:55:05
// 1. for undefined variable a, typeof functio...
Created by Dr. Xi on December 12, 2007 20:30:01 Last update: December 12, 2007 20:32:23
This is a script to tail a log file through the web browser. It uses AJAX, apache web server, mod_python, UNIX utilities tail (requires the --lines switch) and wc . The log file may reside on the web server or any other host accessible from the web server through SSH. Although it's written in python, it should be easy to port to other languages such as Perl. Apache httpd.conf :
LoadModule python_module modules/mod_python.so ...Python script:
import time, os from os.path import basename ...
Created by Dr. Xi on November 15, 2007 04:40:44 Last update: November 15, 2007 04:40:44
Here's some simple Ajax code. The Ajax response is delivered as XML with attributes and an array of data payloads contained in CDATA sections:
// ajax.js function ajaxGet(url, ajaxCallback) ...And the HTML test code:
Created by Dr. Xi on August 10, 2007 21:05:26 Last update: August 10, 2007 21:05:26
<?xml version="1.0" encoding="UTF-8"?> <xsl...