本文整理汇总了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;
}
示例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;
}
示例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);
}
}
示例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");
}
示例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;
}
示例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