本文整理汇总了Java中org.apache.jasper.servlet.JspCServletContext.setAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java JspCServletContext.setAttribute方法的具体用法?Java JspCServletContext.setAttribute怎么用?Java JspCServletContext.setAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jasper.servlet.JspCServletContext
的用法示例。
在下文中一共展示了JspCServletContext.setAttribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initServletContext
import org.apache.jasper.servlet.JspCServletContext; //导入方法依赖的package包/类
private void initServletContext() {
try {
context =new JspCServletContext
(new PrintWriter(new OutputStreamWriter(System.out, "UTF-8")),
new URL("file:" + uriRoot.replace('\\','/') + '/'));
tldScanner = new TldScanner(context, isValidationEnabled);
// START GlassFish 750
taglibs = new ConcurrentHashMap<String, TagLibraryInfo>();
context.setAttribute(Constants.JSP_TAGLIBRARY_CACHE, taglibs);
tagFileJarUrls = new ConcurrentHashMap<String, URL>();
context.setAttribute(Constants.JSP_TAGFILE_JAR_URLS_CACHE,
tagFileJarUrls);
// END GlassFish 750
} catch (MalformedURLException me) {
System.out.println("**" + me);
} catch (UnsupportedEncodingException ex) {
}
rctxt = new JspRuntimeContext(context, this);
jspConfig = new JspConfig(context);
tagPluginManager = new TagPluginManager(context);
}
示例2: initServletContext
import org.apache.jasper.servlet.JspCServletContext; //导入方法依赖的package包/类
protected void initServletContext(ClassLoader classLoader)
throws IOException, JasperException {
// TODO: should we use the Ant Project's log?
PrintWriter log = new PrintWriter(System.out);
URL resourceBase = new File(uriRoot).getCanonicalFile().toURI().toURL();
context = new JspCServletContext(log, resourceBase, classLoader,
isValidateXml(), isBlockExternal());
if (isValidateTld()) {
context.setInitParameter(Constants.XML_VALIDATION_TLD_INIT_PARAM, "true");
}
initTldScanner(context, classLoader);
try {
scanner.scan();
} catch (SAXException e) {
throw new JasperException(e);
}
tldCache = new TldCache(context, scanner.getUriTldResourcePathMap(),
scanner.getTldResourcePathTaglibXmlMap());
context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME, tldCache);
rctxt = new JspRuntimeContext(context, this);
jspConfig = new JspConfig(context);
tagPluginManager = new TagPluginManager(context);
}