本文整理汇总了Java中org.apache.tomcat.util.descriptor.tld.TaglibXml类的典型用法代码示例。如果您正苦于以下问题:Java TaglibXml类的具体用法?Java TaglibXml怎么用?Java TaglibXml使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TaglibXml类属于org.apache.tomcat.util.descriptor.tld包,在下文中一共展示了TaglibXml类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseTld
import org.apache.tomcat.util.descriptor.tld.TaglibXml; //导入依赖的package包/类
protected void parseTld(TldResourcePath path) throws IOException, SAXException {
if (tldResourcePathTaglibXmlMap.containsKey(path)) {
// TLD has already been parsed as a result of processing web.xml
return;
}
TaglibXml tld = tldParser.parse(path);
String uri = tld.getUri();
if (uri != null) {
if (!uriTldResourcePathMap.containsKey(uri)) {
uriTldResourcePathMap.put(uri, path);
}
}
tldResourcePathTaglibXmlMap.put(path, tld);
if (tld.getListeners() != null) {
listeners.addAll(tld.getListeners());
}
}
示例2: TldCache
import org.apache.tomcat.util.descriptor.tld.TaglibXml; //导入依赖的package包/类
public TldCache(ServletContext servletContext,
Map<String, TldResourcePath> uriTldResourcePathMap,
Map<TldResourcePath, TaglibXml> tldResourcePathTaglibXmlMap) {
this.servletContext = servletContext;
this.uriTldResourcePathMap.putAll(uriTldResourcePathMap);
for (Entry<TldResourcePath, TaglibXml> entry : tldResourcePathTaglibXmlMap.entrySet()) {
TldResourcePath tldResourcePath = entry.getKey();
long lastModified[] = getLastModified(tldResourcePath);
TaglibXmlCacheEntry cacheEntry = new TaglibXmlCacheEntry(
entry.getValue(), lastModified[0], lastModified[1]);
this.tldResourcePathTaglibXmlMap.put(tldResourcePath, cacheEntry);
}
boolean validate = Boolean.parseBoolean(
servletContext.getInitParameter(Constants.XML_VALIDATION_TLD_INIT_PARAM));
String blockExternalString = servletContext.getInitParameter(
Constants.XML_BLOCK_EXTERNAL_INIT_PARAM);
boolean blockExternal;
if (blockExternalString == null) {
blockExternal = true;
} else {
blockExternal = Boolean.parseBoolean(blockExternalString);
}
tldParser = new TldParser(true, validate, blockExternal);
}
示例3: getTaglibXml
import org.apache.tomcat.util.descriptor.tld.TaglibXml; //导入依赖的package包/类
public TaglibXml getTaglibXml(TldResourcePath tldResourcePath) throws JasperException {
TaglibXmlCacheEntry cacheEntry = tldResourcePathTaglibXmlMap.get(tldResourcePath);
long lastModified[] = getLastModified(tldResourcePath);
if (lastModified[0] != cacheEntry.getWebAppPathLastModified() ||
lastModified[1] != cacheEntry.getEntryLastModified()) {
synchronized (cacheEntry) {
if (lastModified[0] != cacheEntry.getWebAppPathLastModified() ||
lastModified[1] != cacheEntry.getEntryLastModified()) {
// Re-parse TLD
TaglibXml updatedTaglibXml;
try {
updatedTaglibXml = tldParser.parse(tldResourcePath);
} catch (IOException | SAXException e) {
throw new JasperException(e);
}
cacheEntry.setTaglibXml(updatedTaglibXml);
cacheEntry.setWebAppPathLastModified(lastModified[0]);
cacheEntry.setEntryLastModified(lastModified[1]);
}
}
}
return cacheEntry.getTaglibXml();
}
示例4: scanPlatform
import org.apache.tomcat.util.descriptor.tld.TaglibXml; //导入依赖的package包/类
@Override
protected void scanPlatform() {
super.scanPlatform();
if (URLClassLoaderFirst.shouldSkipJsf(Thread.currentThread().getContextClassLoader(), "javax.faces.FactoryFinder")) {
uriTldResourcePathMapParent.putAll(URI_TLD_RESOURCE);
tldResourcePathTaglibXmlMapParent.putAll(TLD_RESOURCE_TAG_LIB);
} else { // exclude myfaces
for (final Map.Entry<String, TldResourcePath> entry : URI_TLD_RESOURCE.entrySet()) {
final TldResourcePath path = entry.getValue();
if (path.getUrl() != MYFACES_URL) { // ref works
uriTldResourcePathMapParent.put(entry.getKey(), path);
final TaglibXml tl = TLD_RESOURCE_TAG_LIB.get(path);
if (tl != null) {
tldResourcePathTaglibXmlMapParent.put(path, tl);
}
}
}
}
}
示例5: TaglibXmlCacheEntry
import org.apache.tomcat.util.descriptor.tld.TaglibXml; //导入依赖的package包/类
public TaglibXmlCacheEntry(TaglibXml taglibXml, long webAppPathLastModified,
long entryLastModified) {
this.taglibXml = taglibXml;
this.webAppPathLastModified = webAppPathLastModified;
this.entryLastModified = entryLastModified;
}
示例6: setTaglibXml
import org.apache.tomcat.util.descriptor.tld.TaglibXml; //导入依赖的package包/类
public void setTaglibXml(TaglibXml taglibXml) {
this.taglibXml = taglibXml;
}
示例7: TomEETldScanner
import org.apache.tomcat.util.descriptor.tld.TaglibXml; //导入依赖的package包/类
public TomEETldScanner(final ServletContext context, final boolean namespaceAware, final boolean validate, final boolean blockExternal) {
super(context, namespaceAware, validate, blockExternal);
uriTldResourcePathMapParent = (Map<String, TldResourcePath>) Reflections.get(this, "uriTldResourcePathMap");
tldResourcePathTaglibXmlMapParent = (Map<TldResourcePath, TaglibXml>) Reflections.get(this, "tldResourcePathTaglibXmlMap");
// we don't care about listeners since we add it ourself
}
示例8: TckTlds
import org.apache.tomcat.util.descriptor.tld.TaglibXml; //导入依赖的package包/类
public TckTlds(final ServletContext context) {
super(context,
(Map<String, TldResourcePath>) Reflections.get(SCANNER, "uriTldResourcePathMap"),
(Map<TldResourcePath, TaglibXml>) Reflections.get(SCANNER, "tldResourcePathTaglibXmlMap"));
}
示例9: getTldResourcePathTaglibXmlMap
import org.apache.tomcat.util.descriptor.tld.TaglibXml; //导入依赖的package包/类
/**
* Returns the map of TldResourcePath to parsed XML files built by this
* scanner.
*
* @return the map of TldResourcePath to parsed XML files
*/
public Map<TldResourcePath,TaglibXml> getTldResourcePathTaglibXmlMap() {
return tldResourcePathTaglibXmlMap;
}