}
if (usePerRequestCache) {
// Search the sax buffer in request attributes
String attributeName = "DynamicSelectionListCache/" + url;
SaxBuffer saxBuffer = (request != null ? (SaxBuffer)request.getAttribute(attributeName) : null);
if (saxBuffer == null) {
// Not found: generate the list and store it
saxBuffer = new SaxBuffer();
generateSaxFragmentFromSrc(url, saxBuffer, locale);
if (request != null) {
request.setAttribute(attributeName, saxBuffer);
}
}
// Output the stored saxBuffer to the contentHandler
saxBuffer.toSAX(contentHandler);
} else { // We don't use usePerRequestCache => re-read from the source.
generateSaxFragmentFromSrc(url, contentHandler, locale);
}
}