本文整理汇总了Java中org.apache.catalina.core.StandardContext.setAliases方法的典型用法代码示例。如果您正苦于以下问题:Java StandardContext.setAliases方法的具体用法?Java StandardContext.setAliases怎么用?Java StandardContext.setAliases使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.core.StandardContext
的用法示例。
在下文中一共展示了StandardContext.setAliases方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testBug56029
import org.apache.catalina.core.StandardContext; //导入方法依赖的package包/类
@Test
public void testBug56029() throws Exception {
Tomcat tomcat = getTomcatInstance();
File appDir = new File("test/webapp-3.0");
// app dir is relative to server home
StandardContext ctxt = (StandardContext) tomcat.addWebapp(
null, "/test", appDir.getAbsolutePath());
// This test needs the JSTL libraries
File lib = new File("webapps/examples/WEB-INF/lib");
ctxt.setAliases("/WEB-INF/lib=" + lib.getCanonicalPath());
tomcat.start();
ByteChunk res = getUrl("http://localhost:" + getPort() +
"/test/bug5nnnn/bug56029.jspx");
String result = res.toString();
Assert.assertTrue(result.contains("[1]:[1]"));
}
示例2: testBug56147
import org.apache.catalina.core.StandardContext; //导入方法依赖的package包/类
@Test
public void testBug56147() throws Exception {
Tomcat tomcat = getTomcatInstance();
File appDir = new File("test/webapp-3.0");
// app dir is relative to server home
StandardContext ctx = (StandardContext) tomcat.addWebapp(
null, "/test", appDir.getAbsolutePath());
// This test needs the JSTL libraries
File lib = new File("webapps/examples/WEB-INF/lib");
ctx.setAliases("/WEB-INF/lib=" + lib.getCanonicalPath());
tomcat.start();
ByteChunk res = getUrl("http://localhost:" + getPort() +
"/test/bug5nnnn/bug56147.jsp");
String result = res.toString();
assertEcho(result, "00-OK");
}
示例3: testBug48701Fail
import org.apache.catalina.core.StandardContext; //导入方法依赖的package包/类
@Test
public void testBug48701Fail() throws Exception {
Tomcat tomcat = getTomcatInstance();
File appDir =
new File("test/webapp-3.0");
// app dir is relative to server home
StandardContext ctxt = (StandardContext) tomcat.addWebapp(null,
"/test", appDir.getAbsolutePath());
// This test needs the JSTL libraries
File lib = new File("webapps/examples/WEB-INF/lib");
ctxt.setAliases("/WEB-INF/lib=" + lib.getCanonicalPath());
tomcat.start();
int rc = getUrl("http://localhost:" + getPort() +
"/test/bug48nnn/bug48701-fail.jsp", new ByteChunk(), null);
assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, rc);
}
示例4: testBug50408
import org.apache.catalina.core.StandardContext; //导入方法依赖的package包/类
@Test
public void testBug50408() throws Exception {
Tomcat tomcat = getTomcatInstance();
File appDir = new File("test/webapp-3.0");
// app dir is relative to server home
StandardContext ctxt = (StandardContext) tomcat.addWebapp(null,
"/test", appDir.getAbsolutePath());
// This test needs the JSTL libraries
File lib = new File("webapps/examples/WEB-INF/lib");
ctxt.setAliases("/WEB-INF/lib=" + lib.getCanonicalPath());
tomcat.start();
int rc = getUrl("http://localhost:" + getPort() +
"/test/bug5nnnn/bug50408.jsp", new ByteChunk(), null);
assertEquals(HttpServletResponse.SC_OK, rc);
}
示例5: testBug56265
import org.apache.catalina.core.StandardContext; //导入方法依赖的package包/类
@Test
public void testBug56265() throws Exception {
Tomcat tomcat = getTomcatInstance();
File appDir = new File("test/webapp-3.0");
// app dir is relative to server home
StandardContext ctxt = (StandardContext) tomcat.addWebapp(null,
"/test", appDir.getAbsolutePath());
// This test needs the JSTL libraries
File lib = new File("webapps/examples/WEB-INF/lib");
ctxt.setAliases("/WEB-INF/lib=" + lib.getCanonicalPath());
tomcat.start();
ByteChunk res = getUrl("http://localhost:" + getPort() +
"/test/bug5nnnn/bug56265.jsp");
String result = res.toString();
Assert.assertTrue(result,
result.contains("[1: [data-test]: [window.alert('Hello World <&>!')]]"));
Assert.assertTrue(result,
result.contains("[2: [data-test]: [window.alert('Hello World <&>!')]]"));
Assert.assertTrue(result,
result.contains("[3: [data-test]: [window.alert('Hello 'World <&>'!')]]"));
Assert.assertTrue(result,
result.contains("[4: [data-test]: [window.alert('Hello 'World <&>'!')]]"));
}
示例6: testELTagFilePageContext
import org.apache.catalina.core.StandardContext; //导入方法依赖的package包/类
@Test
public void testELTagFilePageContext() throws Exception {
Tomcat tomcat = getTomcatInstance();
File appDir = new File("test/webapp-3.0");
// app dir is relative to server home
StandardContext ctxt = (StandardContext) tomcat.addWebapp(
null, "/test", appDir.getAbsolutePath());
// This test needs the JSTL libraries
File lib = new File("webapps/examples/WEB-INF/lib");
ctxt.setAliases("/WEB-INF/lib=" + lib.getCanonicalPath());
tomcat.start();
ByteChunk out = new ByteChunk();
int rc = getUrl("http://localhost:" + getPort() + "/test/bug5nnnn/bug58178.jsp", out, null);
Assert.assertEquals(HttpServletResponse.SC_OK, rc);
String result = out.toString();
Assert.assertTrue(result, result.contains("PASS"));
}
示例7: testBug56334And56561
import org.apache.catalina.core.StandardContext; //导入方法依赖的package包/类
@Test
public void testBug56334And56561() throws Exception {
Tomcat tomcat = getTomcatInstance();
File appDir = new File("test/webapp-3.0");
// app dir is relative to server home
StandardContext ctxt = (StandardContext) tomcat.addWebapp(null,
"/test", appDir.getAbsolutePath());
// This test needs the JSTL libraries
File lib = new File("webapps/examples/WEB-INF/lib");
ctxt.setAliases("/WEB-INF/lib=" + lib.getCanonicalPath());
tomcat.start();
ByteChunk res = getUrl("http://localhost:" + getPort() +
"/test/bug5nnnn/bug56334and56561.jspx");
String result = res.toString();
// NOTE: The expected values must themselves be \ escaped below
Assert.assertTrue(result, result.contains("01a\\?resize01a"));
Assert.assertTrue(result, result.contains("01b\\\\x\\?resize01b"));
Assert.assertTrue(result, result.contains("<set data-value=\"02a\\\\?resize02a\"/>"));
Assert.assertTrue(result, result.contains("<set data-value=\"02b\\\\\\\\x\\\\?resize02b\"/>"));
Assert.assertTrue(result, result.contains("<set data-value=\"03a\\?resize03a\"/>"));
Assert.assertTrue(result, result.contains("<set data-value=\"03b\\\\x\\?resize03b\"/>"));
Assert.assertTrue(result, result.contains("<04a\\?resize04a/>"));
Assert.assertTrue(result, result.contains("<04b\\\\x\\?resize04b/>"));
Assert.assertTrue(result, result.contains("<set data-value=\"05a$${&\"/>"));
Assert.assertTrue(result, result.contains("<set data-value=\"05b$${&2\"/>"));
Assert.assertTrue(result, result.contains("<set data-value=\"05c##{>hello<\"/>"));
Assert.assertTrue(result, result.contains("05x:<set data-value=\"\"/>"));
Assert.assertTrue(result, result.contains("<set xmlns:foo=\"urn:06a\\bar\\baz\"/>"));
Assert.assertTrue(result, result.contains("07a:<set data-value=\"\\?resize\"/>"));
Assert.assertTrue(result, result.contains("07b:<set data-content=\"\\?resize=.+\"/>"));
Assert.assertTrue(result, result.contains("07c:<set data-content=\"\\?resize=.+\"/>"));
Assert.assertTrue(result, result.contains("07d:<set data-content=\"false\"/>"));
Assert.assertTrue(result, result.contains("07e:<set data-content=\"false\"/>"));
Assert.assertTrue(result, result.contains("07f:<set data-content=\"\\\'something\'\"/>"));
Assert.assertTrue(result, result.contains("07g:<set data-content=\"\\\'something\'\"/>"));
}