當前位置: 首頁>>代碼示例>>Java>>正文


Java WebArchive.addAsWebResource方法代碼示例

本文整理匯總了Java中org.jboss.shrinkwrap.api.spec.WebArchive.addAsWebResource方法的典型用法代碼示例。如果您正苦於以下問題:Java WebArchive.addAsWebResource方法的具體用法?Java WebArchive.addAsWebResource怎麽用?Java WebArchive.addAsWebResource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jboss.shrinkwrap.api.spec.WebArchive的用法示例。


在下文中一共展示了WebArchive.addAsWebResource方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "news-test.war");
	war.addPackage(Param.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebResource(new FileAsset(new File("src/test/resources/index.html")), "index.html");
	war.addAsWebResource(new FileAsset(new File("src/test/resources/form.html")), "form.html");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:11,代碼來源:NewsTestCase.java

示例2: deploy

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment(testable = false)
public static WebArchive deploy() throws URISyntaxException {
	final WebArchive war = create(WebArchive.class, "fileupload-test.war");
	war.addPackage(FileUploadServlet.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebResource(new FileAsset(new File("src/main/webapp/view/fileupload.jsp")), "view/fileupload.jsp");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:10,代碼來源:FileUploadTestCase.java

示例3: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "cookies-test.war");
	war.addPackage(CookiesServlet.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebResource(new FileAsset(new File("src/main/webapp/view/cookies.jsp")), "view/cookies.jsp");
	war.addAsWebResource(new FileAsset(new File("src/main/webapp/view/index-cookies.jsp")),
			"view/index-cookies.jsp");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:12,代碼來源:CookiesTestCase.java

示例4: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "nonblocking-test.war");
	war.addPackage(ReadingServlet.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebResource(new FileAsset(new File("src/main/webapp/view/nonblocking.jsp")), "view/nonblocking.jsp");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:10,代碼來源:NonBlockingTestCase.java

示例5: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "errormappings-test.war");
	war.addPackage(ErrorMappingServlet.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebResource(new FileAsset(new File("src/main/webapp/view/errormapping.jsp")), "view/errormapping.jsp");
	war.addAsWebResource(new FileAsset(new File("src/main/webapp/view/error-404.jsp")), "view/error-404.jsp");
	war.addAsWebResource(new FileAsset(new File("src/main/webapp/view/error-exception.jsp")),
			"view/error-exception.jsp");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/web-errormapping.xml")), "web.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:13,代碼來源:ErrorMappingTestCase.java

示例6: createWebDeployment

import org.jboss.shrinkwrap.api.spec.WebArchive; //導入方法依賴的package包/類
@Deployment
public static WebArchive createWebDeployment() {
	final WebArchive war = create(WebArchive.class, "secure-test.war");
	war.addPackage(SessionSocketServer.class.getPackage());
	war.addAsWebInfResource(INSTANCE, "beans.xml");
	war.addAsWebInfResource(new FileAsset(new File("src/test/resources/secure-web.xml")), "web.xml");
	war.addAsWebResource(new FileAsset(new File("src/test/resources/index.html")), "index.html");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:10,代碼來源:SessionSecureTestCase.java


注:本文中的org.jboss.shrinkwrap.api.spec.WebArchive.addAsWebResource方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。