Recent Notes

Displaying keyword search results 1 - 8
Created by Fang on January 04, 2012 09:54:05    Last update: January 04, 2012 09:54:05
There are two ways to validate a form with JSF: jsf validation on the page with <f:validate...> tags (for example: <f:validateLength> , <f:validateRegex> , etc.), or JSR303 bean validation. This note is about how to customize messages for JSR303 bean validation. The validation message is specified in the message attribute for each validation annotation type. The mesage attribute is not a literal string, but a string that is interpolated in various ways. For example, the default validation message for AssertFalse is {javax.validation.constraints.AssertFalse.message} , which is replaced with the corresponding string in ValidationMessages.properties (or ValidationMessages_tr.properties , ValidationMessages_es.properties , depending on the locale). This is the contents of ValidationMessages.properties in the hibernate validator reference implementation: javax.validation.constraints.AssertFalse.message =... To customize the messages, just provide the new value in...
Created by James on March 13, 2011 13:44:37    Last update: March 21, 2011 11:30:55
This is a jQuery input control that lets you enter any number of input rows of name and value pairs. <!DOCTYPE html> <html> <head> <title>jQu...
Created by James on October 11, 2010 19:01:28    Last update: January 11, 2011 20:38:56
Test page (click the "new window" icon to see the transition): <!DOCTYPE html> <html> <head> <title>jQu...
Created by Dr. Xi on October 26, 2010 04:47:37    Last update: January 11, 2011 20:00:36
The code presented here is a simple implementation of a tab set. It is used to demo how a tab set could be implemented. The code is stand alone and does not depend on any JavaScript libraries. Multiple tab sets within the same page is supported. The HTML markup is fairly simple: Tabs sets are contained within a DIV element with class name "tabsContainer". Define a UL list for the tabs. Follow the UL list with equal number of DIVs for the tab contents. The Nifty Corners Cube technique is used to draw the rounded corners (original form, not the enhanced JavaScript form). HTML, CSS and JavaScript: <!doctype html> <html> <head> <style typ...
Created by James on September 10, 2010 23:01:14    Last update: September 10, 2010 23:01:14
By default, heights for jQuery UI tab panels expand or contract depending on the height of each tab. The code snippet here sets the height of all tabs to be equal to that of the container. <!DOCTYPE html> <html> <head> <title>jQu...
Created by nogeek on June 01, 2010 14:34:12    Last update: June 01, 2010 14:34:12
Test with curl and default Apache doc. C:\>curl --dump-header - http://localhost HTTP/...
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 <project xmlns="http://maven.apache.org/POM/4.0.0"... SplashTag.java package tagdemo; import java.util.ArrayList......
Created by Dr. Xi on September 29, 2008 23:05:12    Last update: September 29, 2008 23:06:16
These variables are set or used by the Unix shell to modify its behavior. Variable Description ENV=file Name of script that gets executed at startup; Usually, ENV=$HOME/.kshrc FCEDIT=file Editor used by fc (fix command) command. If $FCEDIT is not defined, use $EDITOR, otherwise use the default (vi or ed). FPATH=dirs Directories to search for function definitions; undefined functions are set via typeset -fu . FPATH is searched when these functions are first referenced. HISTFILE=file File in which to store command history. Default is $HOME/.sh_history for Korn shell, $HOME/.bash_history for Bash. If not set, history is lost after logout. HISTSIZE=n Max number of commands to keep in history. HOME=dir Home directory; set by login from passwd file. IFS='chars' Internal field separators. Default is space, tab, and...