Displaying keyword search results 1 - 5
Created by alfa on June 02, 2011 15:49:26 Last update: June 02, 2011 15:51:08
Facts: Dynamic proxy classes are generated by the Java runtime, from a list of interfaces given by the user. The generated proxy class implements all interfaces given by the user. The dynamic proxy class is not synthetic . The dynamic proxy class is useless without a user supplied InvocationHandler class, since there's only one constructor for the proxy class and it takes a InvocationHandler as parameter. Example code:
import java.lang.reflect.Constructor; import ja...Output:
Class: $Proxy0 isSynthetic: false Constructo...
Created by James on July 19, 2009 20:51:23 Last update: January 11, 2011 20:14:18
If CSS3 border-image is properly supported, making a rounded corner box is very easy. You just need a round corner image like this: The following markup:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ...would render like this (try it in Firefox 3.5 and Google Chrome): However, IE as of version 8.0 does not support border-image . So until border-image is reliably supported in all major browsers, we still have to rely on tried and true tricks to make it work. In general, I found three general categories of tricks to make rounded corners: Good old tables. This trick creates a table of 9 cells and uses the 8 cells on the perimeter to render the borders and rounded corners. The central cell is used for...
Created by Dr. Xi on July 19, 2010 21:58:34 Last update: July 23, 2010 21:37:23
Parsing XML in Java is really simple:
import java.io.*; import javax.xml.parsers.Docu...The parser implementation details are hidden behind the JAXP API. In case you want to know which parser implementation is used, this is what the JavaDoc for DocumentBuilderFactory.newInstance says: Use the javax.xml.parsers.DocumentBuilderFactory system property. Use the properties file " lib/jaxp.properties " in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above. The jaxp.properties file is read only once by the JAXP implementation and it's values are then cached for future use. If the file does not exist when the first attempt is made to read from it, no further attempts are made to...
Created by Dr. Xi on June 20, 2010 14:35:17 Last update: June 20, 2010 14:35:17
This XML signature validator comes from the Apache XML Security project. It validates the signature according to the core validation processing rules . It does not verify that the key used to generate the signature is a trusted key. You can override the KeySelector class to make sure that the signing key is from a trusted store.
import javax.xml.crypto.*; import javax.xml.cry...
Created by Dr. Xi on June 11, 2010 23:11:59 Last update: June 11, 2010 23:14:02
Given a simple XML file like this:
<?xml version="1.0"?> <root id="1"> ...Calling Document.getElementById returns null (surprisingly!):
import java.io.*; import org.w3c.dom.*; impo...In fact the JavaDoc says something along the lines that getElementById returns the Element that has an ID attribute with the given value. An attribute with the name "ID" or "id" is not of type ID unless it is so defined. How is an attribute defined as an ID attribute ? With a DTD or schema. If you are not validating the XML, then the API is useless. So, what to do if you want to find an element for which the attribute named "id" has a given value? Several options were offered in GetElementById Pitfalls . One of them is to...