...
In order to take advantage of the secure XML processing defaults of the library, it is strongly recommended that you use our wrapper of JAXP DocumentBuilderFactory
. BasicParserPool
from our java-support utility library is a thread-safe implementation of a pool of DocumentBuilder
instances that provide a secure default configuration, addressing the common classes of XML processing security vulnerabilities.
Basic usage of the pool implementation would similar to the following:
Code Block | ||
---|---|---|
| ||
// One-time instantiation and init for the entire application.
BasicParserPool pp = new BasicParserPool();
pp.initialize();
// Runtime parsing
Document doc = getParserPool().parse(inputStream); // or Reader |
Custom JAXP-Based Processing
...