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


Java WARArchive.setContextRoot方法代码示例

本文整理汇总了Java中org.wildfly.swarm.undertow.WARArchive.setContextRoot方法的典型用法代码示例。如果您正苦于以下问题:Java WARArchive.setContextRoot方法的具体用法?Java WARArchive.setContextRoot怎么用?Java WARArchive.setContextRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.wildfly.swarm.undertow.WARArchive的用法示例。


在下文中一共展示了WARArchive.setContextRoot方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getImplicitDeployments

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
@Override
public List<Archive> getImplicitDeployments(TopologyWebAppFraction fraction) throws Exception {
    String context = System.getProperty(TopologyProperties.CONTEXT_PATH);
    if (context == null) context = DEFAULT_CONTEXT;

    List<Archive> list = new ArrayList<>();
    if (fraction.exposeTopologyEndpoint()) {
        WARArchive war = ShrinkWrap.create(WARArchive.class, "topology-webapp.war");
        war.addAsWebInfResource(new StringAsset(getWebXml(fraction)), "web.xml");
        war.addClass(TopologySSEServlet.class);
        war.addModule("swarm.application");
        war.addModule("org.wildfly.swarm.topology");
        war.addAsWebResource(new ClassLoaderAsset("topology.js", this.getClass().getClassLoader()), "topology.js");
        war.setContextRoot(context);
        war.as(TopologyArchive.class);
        list.add(war);
    }
    return list;
}
 
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-topology,代码行数:20,代码来源:TopologyWebAppConfiguration.java

示例2: deployment

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
@Produces
@Dependent()
Archive deployment() {

    String context = TopologyWebAppFraction.DEFAULT_CONTEXT;
    if (this.contextPath != null) {
        context = this.contextPath;
    }

    if (fraction.exposeTopologyEndpoint()) {
        WARArchive war = ShrinkWrap.create(WARArchive.class, "topology-webapp.war");
        war.addAsWebInfResource(new StringAsset(getWebXml(fraction)), "web.xml");
        war.addClass(TopologySSEServlet.class);
        war.addModule("swarm.application");
        war.addModule("org.wildfly.swarm.topology");
        war.addAsWebResource(new ClassLoaderAsset("topology.js", this.getClass().getClassLoader()), "topology.js");
        war.setContextRoot(context);
        war.as(TopologyArchive.class);
        return war;
    }
    return null;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:23,代码来源:TopologyWebAppDeploymentProducer.java

示例3: getImplicitDeployments

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
@Override
public List<Archive> getImplicitDeployments(TopologyWebAppFraction fraction) throws Exception {
    String context = System.getProperty(TopologyProperties.CONTEXT_PATH);
    if (context == null) context = DEFAULT_CONTEXT;

    List<Archive> list = new ArrayList<>();
    WARArchive war = ShrinkWrap.create(WARArchive.class, "topology-webapp.war");
    war.addAsWebInfResource(new StringAsset(getWebXml(fraction)), "web.xml");
    war.addClass(TopologySSEServlet.class);
    war.addModule("swarm.application");
    war.addModule("org.wildfly.swarm.topology");
    war.addAsWebResource(new ClassLoaderAsset("topology.js", this.getClass().getClassLoader()), "topology.js");
    war.setContextRoot(context);
    war.as(TopologyArchive.class);
    list.add(war);
    return list;
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:18,代码来源:TopologyWebAppConfiguration.java

示例4: getSecond

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
@Deployment(testable = false)
public static Archive getSecond() throws Exception {
    WARArchive deployment = ShrinkWrap.create(WARArchive.class);
    deployment.setContextRoot("/static");
    deployment.staticContent();
    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:8,代码来源:StaticContentContextRootDeploymentTest.java

示例5: process

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
@Override
public void process() {
    WARArchive warArchive = archive.as(WARArchive.class);

    if (warArchive.getContextRoot() == null) {
        warArchive.setContextRoot(contextPath.get());
    }

    UndertowExternalMountsAsset ut = null;
    if (mounts != null) {
        for (String mountPath : mounts) {
            Path staticPath = Paths.get(mountPath);
            if (!staticPath.isAbsolute()) {
                staticPath = Paths.get(System.getProperty("user.dir"), staticPath.toString()).normalize();
            }
            if (ut == null) {
                ut = new UndertowExternalMountsAsset();
            }
            ut.externalMount(staticPath.toString());
        }
    }

    if (ut != null) {
        warArchive.add(ut, WARArchive.EXTERNAL_MOUNT_PATH);
    }

}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:28,代码来源:ContextPathArchivePreparer.java

示例6: testDefaultContextRootWontOverride

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
@Test
public void testDefaultContextRootWontOverride() throws Exception {
    WARArchive archive = DefaultWarDeploymentFactory.archiveFromCurrentApp();

    assertThat(archive.getContextRoot()).isNull();

    archive.setContextRoot("myRoot");
    assertThat(archive.getContextRoot()).isNotNull();
    assertThat(archive.getContextRoot()).isEqualTo("myRoot");

    new ContextPathArchivePreparer(archive).process();

    assertThat(archive.getContextRoot()).isNotNull();
    assertThat(archive.getContextRoot()).isEqualTo("myRoot");
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:16,代码来源:ContextPathArchivePreparerTest.java

示例7: managementConsoleWar

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
@Produces
public Archive managementConsoleWar() throws Exception {
    // Load the management-ui webjars.
    WARArchive war = ShrinkWrap.create(WARArchive.class, "management-console-ui.war");
    Module module = Module.getBootModuleLoader().loadModule("org.jboss.as.console");
    Iterator<Resource> resources = module.globResources("*");
    while (resources.hasNext()) {
        Resource each = resources.next();
        war.add(new UrlAsset(each.getURL()), each.getName());
    }
    war.setContextRoot(this.fraction.contextRoot());
    return war;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:14,代码来源:ManagementConsoleDeploymentProducer.java

示例8: testStaticContentWithContext

import org.wildfly.swarm.undertow.WARArchive; //导入方法依赖的package包/类
@Test
public void testStaticContentWithContext() throws Exception {
    Container container = newContainer();
    container.start();
    try {
        WARArchive deployment = ShrinkWrap.create(WARArchive.class);
        deployment.setContextRoot("/static");
        deployment.staticContent();
        container.deploy(deployment);
        assertBasicStaticContentWorks("static");
        assertFileChangesReflected("static");
    } finally {
        container.stop();
    }
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:16,代码来源:StaticContentDeploymentTest.java


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