本文整理汇总了Java中org.apache.catalina.core.StandardContext.findChild方法的典型用法代码示例。如果您正苦于以下问题:Java StandardContext.findChild方法的具体用法?Java StandardContext.findChild怎么用?Java StandardContext.findChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.core.StandardContext
的用法示例。
在下文中一共展示了StandardContext.findChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doTestELMisc
import org.apache.catalina.core.StandardContext; //导入方法依赖的package包/类
private void doTestELMisc(boolean quoteAttributeEL) throws Exception {
Tomcat tomcat = getTomcatInstance();
// Create the context (don't use addWebapp as we want to modify the
// JSP Servlet settings).
File appDir = new File("test/webapp-3.0");
StandardContext ctxt = (StandardContext) tomcat.addContext(
null, "/test", appDir.getAbsolutePath());
// Configure the defaults and then tweak the JSP servlet settings
// Note: Min value for maxLoadedJsps is 2
Tomcat.initWebappDefaults(ctxt);
Wrapper w = (Wrapper) ctxt.findChild("jsp");
String jspName;
if (quoteAttributeEL) {
jspName = "/test/el-misc-with-quote-attribute-el.jsp";
w.addInitParameter("quoteAttributeEL", "true");
} else {
jspName = "/test/el-misc-no-quote-attribute-el.jsp";
w.addInitParameter("quoteAttributeEL", "false");
}
tomcat.start();
ByteChunk res = getUrl("http://localhost:" + getPort() + jspName);
String result = res.toString();
assertEcho(result, "00-\\\\\\\"${'hello world'}");
assertEcho(result, "01-\\\\\\\"\\${'hello world'}");
assertEcho(result, "02-\\\"${'hello world'}");
assertEcho(result, "03-\\\"\\hello world");
assertEcho(result, "2az-04");
assertEcho(result, "05-a2z");
assertEcho(result, "06-az2");
assertEcho(result, "2az-07");
assertEcho(result, "08-a2z");
assertEcho(result, "09-az2");
assertEcho(result, "10-${'foo'}bar");
assertEcho(result, "11-\\\"}");
assertEcho(result, "12-foo\\bar\\baz");
assertEcho(result, "13-foo\\bar\\baz");
assertEcho(result, "14-foo\\bar\\baz");
assertEcho(result, "15-foo\\bar\\baz");
assertEcho(result, "16-foo\\bar\\baz");
assertEcho(result, "17-foo\\'bar'\\"baz"");
}