Recent Notes

Displaying keyword search results 21 - 30
Created by Dr. Xi on August 31, 2008 20:43:44    Last update: January 22, 2011 12:48:08
It's probably more useful to make the JavaScript executor a bookmarklet. That way it gains access to the page on which it is invoked. Therefore, more helpful while debugging. Here's the code: <html> <body> <a href="javascript:(funct... Or, you can add this link to your bookmarks, name it "JS Executor". For a full featured JavaScript console, you may need Jash
Created by Dr. Xi on November 23, 2010 20:41:28    Last update: January 14, 2011 16:15:20
The servlet API allows servlet filters to be inserted into the processing cycle to form a Filter Chain . How is a chain defined, and what is the ordering of filters in the chain? The servlet filter chain is formed by defining multiple filters for the same servlet or URL pattern in web.xml . The order in which the filters are invoked is the same order as <filter-mapping> s appear in the web.xml file. For example, if this is defined in web.xml : <!-- Filter mapping --> <filter-mapping> ... then servletFilter2 will be applied before servletFilter . Actually, it's more accurate to imagine these filters as layers or wraps instead of chains. In the above example, servletFilter2 wraps servletFilter .
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 Dr. Xi on November 03, 2007 17:36:24    Last update: January 10, 2011 22:22:43
When rendering an HTML form, it is customary to use an icon to indicate that a field is required. You can render the icon in HTML directly, but it's a lot more convenient to use CSS. Here's the CSS: label.required { background: url(/img/requ... And the HTML: <label class="required">A required field</labe...
Created by nogeek on December 31, 2010 11:56:25    Last update: December 31, 2010 11:56:25
These are the steps to create a JBoss 5.1.0 configuration with Tomcat from the built-in minimal configuration. Change directory to $JBOSS_HOME/server . Make a copy of the minimal configuration. cp -R minimal tomcatonly Copy bindingservice.beans from the default configuration. cp -R default/conf/bindingservice.beans tomcatonly... Copy login-config.xml from the default configuration. cp default/conf/login-config.xml tomcatonly/conf/ Edit tomcatonly/conf/jboss-service.xml : Add jars from the common/lib directory: <!-- Load all jars from the JBOSS_DIST/serv... Add the JAAS security manager section (copy from the default profile, and yes, JBoss tomcat can't live without the JBoss JAAS manager). <!-- JAAS security manager and realm mappin... Copy the Tomcat (JBoss web) deployer from the default configuration. cp -R default/deployers/jbossweb.deployer tomcaton... Copy metadata-deployer-jboss-beans.xml and security-deployer-jboss-beans.xml from the default profile. cp default/deployers/metadata-deployer-jboss-b... Copy...
Created by Fang on August 10, 2010 21:37:36    Last update: October 25, 2010 20:18:47
The tags <fmt:formatNumber> Format a numeric value as number , currency or percentage - controlled by the type attribute (defaults to number if type is missing). Syntax: <fmt:formatNumber value="numericValue" [type="... Attributes: Name Dynamic? Type Description value true String or Number Numeric value to be formatted. type true String Specifies whether the value is to be formatted as number, currency, or percentage. pattern true String Custom formatting pattern, must follow the pattern syntax specified by the class java.text.DecimalFormat . currencyCode true String ISO 4217 currency code. Applied only when formatting currencies (i.e. if type is equal to "currency"); ignored otherwise. currencySymbol true String Currency symbol. Applied only when formatting currencies (i.e. if type is equal to "currency"); ignored otherwise. It is used only when currencyCode is...
Created by Dr. Xi on August 30, 2010 20:17:22    Last update: August 30, 2010 20:17:41
Characters \/:*?"<>| are forbidden in Windows file names. For Python, the effect of using a forbidden character in the file name is undetermined. In the following session a file named mytest can be seen from the Windows Explorer, which contains 0 bytes - as confirmed by the read back in the session. But if you open the file with the invalid file name used to create the file (i.e., mytest: 1.txt ), you get the original contents. C:\>python Python 2.7 (r27:82525, Jul 4 2010, ...
Created by voodoo on July 11, 2009 15:14:55    Last update: July 29, 2010 22:45:48
cURL is a command line tool for transferring files with URL syntax. The main purpose and use for cURL is to automate unattended file transfers or sequences of operations. It's really easy to see HTTP headers with curl: C:\>curl --head http://www.google.com HTTP/1.0 ... or, headers and page together (dump headers to stdout): $ curl --dump-header - http://www.google.com HTTP/... Download openssl from openssl.org: curl http://www.openssl.org/source/openssl-0.9.6m.... C:\>curl --help Usage: curl [options...] <url> ...
Created by Dr. Xi on July 29, 2010 18:46:57    Last update: July 29, 2010 18:48:15
This is an example of using java.beans.XMLEncoder and java.beans.XMLDecoder to serialize/deserialize Java objects to XML. Java code TestXMLEncoder.java: import java.io.*; import java.beans.XMLEncoder;... SimpleBean.java: public class SimpleBean { private String na... CompositeBean.java: public class CompositeBean { private Simple... NotABean.java: public class NotABean { private String name... Test Output By default, only Java beans can be serialized using XMLEncoder . Exception occurs when you try to deserialize an object which is not a Java bean. Errors actually occur when you try to serialize, but they are ignored. As a result, an XML file is generated by the serialization but the file is useless! Console output: C:\>java TestXMLEncoder Testing simple bean ... simplebean.xml: <?xml version="1.0" encoding="UTF-8"?> <java v... compositebean.xml: <?xml version="1.0" encoding="UTF-8"?> <java v... nodefault.xml: <?xml version="1.0" encoding="UTF-8"?> <java v......
Created by Fang on April 04, 2010 04:12:14    Last update: July 21, 2010 14:52:58
The tags <c:if> The <c:if> tag may be used with or without body content: <!-- Without body content, used to export vari... In my opinion, the version without body content is pretty much useless (the <c:set> tag is a lot more meaningful for this purpose). If body content exists, it is inserted into the page if the testCondition is true . Optional attributes var and scope may be specified. If var is specified, a variable whose name is the value of var is exported to the associated scope ( pageScope if no scope is specified). The type of the exported variable is Boolean and its value is the value of the testCondition . <c:choose>, <c:when>, <c:otherwise> These tags imitate the Java control structure if...else...
Previous  1 2 3 4 5 Next