Recent Notes

Displaying keyword search results 1 - 10
Created by Dr. Xi on March 21, 2013 19:47:46    Last update: March 22, 2013 12:30:27
It's normal practice to import types from an external xsd file in WSDL like this: <wsdl:types> <xsd:schema xmlns:xsd="htt... When you use <dynamic-wsdl> and have Commons XMLSchema on the class path, Spring-WS inlines the xsd in the wsdl. But that doesn't happen when you use <static-wsdl> . You can define a SimpleXsdSchema bean to expose the xsd: <?xml version="1.0" encoding="UTF-8"?> <beans x... where the bean id "hello" should match the schemaLocation attribute in the WSDL (without the .xsd suffix). But note that the SimpleXsdSchema does not inline the xsd. It only makes the xsd available via an HTTP URL. Alternatively, you can simply put the xsd file under the content directory of the webapp (just link any CSS or JavaScript). Anyway, that's a lot of manual...
Created by Dr. Xi on February 13, 2012 20:59:35    Last update: February 13, 2012 20:59:54
The insertAttribute tag allows you to have a body as well as specify a default value, but both values are scriptless , i.e., scriptlet is not allowed in body: <tiles:insertAttribute name="javascript"> <scri... and defaultValue is output literally: <tiles:insertAttribute name="javascript" de... And, <put-attribute> in tiles definition does not replace the body of <tiles:insertAttribute> , it appends to the body!
Created by jinx on April 17, 2011 20:40:12    Last update: April 17, 2011 20:40:56
For JavaScript in the <script> block or JavaScript included with a src attribute: nothing more is needed than escaping the single quote or double quote - depending on how the JavaScript string is quoted. Example: var a = 'My name is <?php echo str_replace('\'', '... For inline JavaScript, escape HTML special characters : <?php echo '<a href="test" onclick="alert(\...
Created by James on April 04, 2011 19:41:51    Last update: April 04, 2011 19:41:51
Use the nodeName attribute to get the name of the HTML tag, tagName is not recommended . <!DOCTYPE html> <html> <head> <title>jQu...
Created by James on May 24, 2009 20:14:25    Last update: January 11, 2011 20:07:38
In the following HTML code, I attached an inline handler to the text field input and added two event handlers with addEventListener / attachEvent . Both IE and Firefox called the inline handler first. But the order in which the added event handlers were called are different between IE and Firefox (IE calls attached_click2 first). Further, if I add the same event handler multiple times, IE calls the handler the same number of times. But Firefox only calls the same handler once, no matter how many times it was added. <html> <body> <form> Input: <input type="... You can attach an event handler to an HTML element either inline , with JavaScript , or by calling addEventListener (DOM level 2), or attachEvent (IE specific). When you...
Created by James on January 04, 2011 16:22:43    Last update: January 05, 2011 13:43:06
The jQuery doc says: If you wish to use any of the meta-characters (such as !"#$%&'()*+,./:;?@[\]^`{|}~ ) as a literal part of a name, you must escape the character with two backslashes: \\ . So what are these meta-characters ? According to the CSS specification : In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); These meta-characters are the printable characters in the ASCII but outside the range allowed by CSS identifiers. They must be escaped, with two backslashes. Why two backslashes? Because one backslash is consumed by JavaScript, and with only one backslash in place, no backslash is passed to jQuery...
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 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: <html><body> <object classid="clsid:8AD9C840-04... You need to wrap the JavaScript like this: <script language="JavaScript" type="text/javascrip...
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: <?xml version="1.0" encoding="utf-8"?> <ajax-re... And the JavaScript that does the Ajax magic: // ajax.js function ajaxGet(url, ajaxCallback) ... And the HTML test code: <html> <head> <script language="JavaScript"...