本文整理汇总了Java中org.apache.jasper.JspCompilationContext.getResourcePaths方法的典型用法代码示例。如果您正苦于以下问题:Java JspCompilationContext.getResourcePaths方法的具体用法?Java JspCompilationContext.getResourcePaths怎么用?Java JspCompilationContext.getResourcePaths使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jasper.JspCompilationContext
的用法示例。
在下文中一共展示了JspCompilationContext.getResourcePaths方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ImplicitTagLibraryInfo
import org.apache.jasper.JspCompilationContext; //导入方法依赖的package包/类
/**
* Constructor.
*/
public ImplicitTagLibraryInfo(JspCompilationContext ctxt,
ParserController pc,
String prefix,
String tagdir,
ErrorDispatcher err) throws JasperException {
super(prefix, null);
this.pc = pc;
this.err = err;
this.pageInfo = pc.getCompiler().getPageInfo();
this.tagFileMap = new HashMap<String, String>();
this.vec = new ArrayList<TagFileInfo>();
// Implicit tag libraries have no functions:
this.functions = new FunctionInfo[0];
tlibversion = TLIB_VERSION;
jspversion = JSP_VERSION;
if (!tagdir.startsWith(WEB_INF_TAGS)) {
err.jspError("jsp.error.invalid.tagdir", tagdir);
}
// Determine the value of the <short-name> subelement of the
// "imaginary" <taglib> element
if (tagdir.equals(WEB_INF_TAGS)
|| tagdir.equals( WEB_INF_TAGS + "/")) {
shortname = TAGS_SHORTNAME;
} else {
shortname = tagdir.substring(WEB_INF_TAGS.length());
shortname = shortname.replace('/', '-');
}
// Populate mapping of tag names to tag file paths
Set<String> dirList = ctxt.getResourcePaths(tagdir);
if (dirList != null) {
Iterator it = dirList.iterator();
while (it.hasNext()) {
String path = (String) it.next();
if (path.endsWith(TAG_FILE_SUFFIX)
|| path.endsWith(TAGX_FILE_SUFFIX)) {
/*
* Use the filename of the tag file, without the .tag or
* .tagx extension, respectively, as the <name> subelement
* of the "imaginary" <tag-file> element
*/
String suffix = path.endsWith(TAG_FILE_SUFFIX) ?
TAG_FILE_SUFFIX : TAGX_FILE_SUFFIX;
String tagName = path.substring(path.lastIndexOf("/") + 1);
tagName = tagName.substring(0,
tagName.lastIndexOf(suffix));
tagFileMap.put(tagName, path);
} else if (path.endsWith(IMPLICIT_TLD)) {
String tldName = path.substring(path.lastIndexOf("/") + 1);
if (IMPLICIT_TLD.equals(tldName)) {
parseImplicitTld(ctxt, path);
}
}
}
}
}