当前位置: 首页>>代码示例>>Java>>正文


Java StandardContext.setAliases方法代码示例

本文整理汇总了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]"));
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:23,代码来源:TestELInJsp.java

示例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");
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:22,代码来源:TestELInJsp.java

示例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);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:22,代码来源:TestGenerator.java

示例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);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:21,代码来源:TestCompositeELResolver.java

示例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 <&>'!')]]"));
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:30,代码来源:TestParser.java

示例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"));
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:26,代码来源:TestJspContextWrapper.java

示例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$${&amp;\"/>"));
    Assert.assertTrue(result, result.contains("<set data-value=\"05b$${&amp;2\"/>"));
    Assert.assertTrue(result, result.contains("<set data-value=\"05c##{&gt;hello&lt;\"/>"));
    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\'\"/>"));
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:43,代码来源:TestParser.java


注:本文中的org.apache.catalina.core.StandardContext.setAliases方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。