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


Java WebAppContext.setDescriptor方法代碼示例

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


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

示例1: setUpBeforeClass

import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
/**
 * @throws java.lang.Exception
 */
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
	// start the server:
	server = new Server(port);
	WebAppContext context = new WebAppContext();

	uri = "http://localhost:20100";

	// see if this can be set more dynamically:
	context.setContextPath("/");
	context.setResourceBase(new File("src/main/webapp/").getCanonicalPath());
	context.setDescriptor(new File("src/main/webapp/").getCanonicalPath() + "/WEB-INF/web.xml");

	server.setHandler(context);
	server.start();
}
 
開發者ID:beeldengeluid,項目名稱:zieook,代碼行數:21,代碼來源:TemplateCRUDImplTest.java

示例2: setUpBeforeClass

import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
/**
 * @throws java.lang.Exception
 */
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
	// start the server:
	server = new Server(port);
	WebAppContext context = new WebAppContext();

	uri = "http://localhost:20100";

	// see if this can be set more dynamically:
	context.setContextPath("/");
	context.setResourceBase(new File("src/main/webapp/").getCanonicalPath());
	context.setDescriptor(new File("src/main/webapp/").getCanonicalPath() + "/WEB-INF/web.xml");

	server.setHandler(context);
	server.start();

	ContentProviderCRUD proxy = ProxyFactory.create(ContentProviderCRUD.class, uri);
	proxy.deleteContentProvider(ConstantsTest.CP);
}
 
開發者ID:beeldengeluid,項目名稱:zieook,代碼行數:24,代碼來源:ContentProviderCRUDImplTest.java

示例3: setUpBeforeClass

import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
/**
 * @throws java.lang.Exception
 */
@BeforeClass
public static void setUpBeforeClass() throws Exception
{

	// start the server:
	server = new Server(port);
	WebAppContext context = new WebAppContext();

	uri = "http://localhost:20100";

	// see if this can be set more dynamically:
	context.setContextPath("/");
	context.setResourceBase(new File("src/main/webapp/").getCanonicalPath());
	context.setDescriptor(new File("src/main/webapp/").getCanonicalPath() + "/WEB-INF/web.xml");

	server.setHandler(context);
	server.start();
}
 
開發者ID:beeldengeluid,項目名稱:zieook,代碼行數:22,代碼來源:RecommenderImplTest.java

示例4: setUpBeforeClass

import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
/**
 * @throws java.lang.Exception
 */
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
	// start the server:
	server = new Server(port);
	WebAppContext context = new WebAppContext();

	uri = "http://localhost:20100";

	// see if this can be set more dynamically:
	context.setContextPath("/");
	context.setResourceBase(new File("src/main/webapp/").getCanonicalPath());
	context.setDescriptor(new File("src/main/webapp/").getCanonicalPath() + "/WEB-INF/web.xml");

	server.setHandler(context);
	server.start();

	ContentProviderCRUD proxy1 = ProxyFactory.create(ContentProviderCRUD.class, uri);
	proxy1.createContentProvider(new ContentProvider(ConstantsTest.CP, System.currentTimeMillis() / 1000, true));

	CollectionImport proxy2 = ProxyFactory.create(CollectionImport.class, uri);
	proxy2.deleteCollection(ConstantsTest.CP, ConstantsTest.COLLECTION);
}
 
開發者ID:beeldengeluid,項目名稱:zieook,代碼行數:27,代碼來源:CollectionImportImplTest.java

示例5: setUpBeforeClass

import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
/**
 * @throws java.lang.Exception
 */
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
	// start the server:
	server = new Server(port);
	WebAppContext context = new WebAppContext();

	uri = "http://localhost:20200";

	// see if this can be set more dynamically:
	context.setContextPath("/");
	context.setResourceBase(new File("src/main/webapp/").getCanonicalPath());
	context.setDescriptor(new File("src/main/webapp/").getCanonicalPath() + "/WEB-INF/web.xml");

	server.setHandler(context);
	server.start();
}
 
開發者ID:beeldengeluid,項目名稱:zieook,代碼行數:21,代碼來源:UserDataImplTest.java

示例6: setUp

import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
/**
 * @throws java.lang.Exception
 */
@BeforeClass
public static void setUp() throws Exception
{
	// start the server:
	server = new Server(port);
	WebAppContext context = new WebAppContext();

	uri = "http://localhost:20200";

	// see if this can be set more dynamically:
	context.setContextPath("/");
	context.setResourceBase(new File("src/main/webapp/").getCanonicalPath());
	context.setDescriptor(new File("src/main/webapp/").getCanonicalPath() + "/WEB-INF/web.xml");

	server.setHandler(context);
	server.start();
}
 
開發者ID:beeldengeluid,項目名稱:zieook,代碼行數:21,代碼來源:RecommenderImplTest.java

示例7: main

import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception
{
    Server server = new Server(8080);

    WebAppContext context = new WebAppContext();
    context.setDescriptor(WEB_XML_PATH);
    context.setResourceBase(WEBAPPS_PATH);
    context.setContextPath("/");
    context.setParentLoaderPriority(true);

    server.setHandler(context);

    server.start();
    server.join();
}
 
開發者ID:anstarovoyt,項目名稱:rush,代碼行數:16,代碼來源:App.java

示例8: main

import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {
int port = 8080;
if (args.length != 1) {
	printMessage();
} else {
	int argPort = port;
	try {
		argPort = Integer.parseInt(args[0]);
	} catch (NumberFormatException e) {
		printMessage();
	}
	if (argPort < 0) {
		System.err
				.println("Port number cannot be negative. Reverting to default port 8080.");
		argPort = port;
	}
	port = argPort;
}
Server server = new Server(port);
  	
  	DB db = new DB();
  	
  	db.loadDriver();
  	if (db.isIndexEmpty()) {
  		System.out.println("No indexes found. Please create an index before starting the application.");
  		db.shutdown();
  		System.exit(0);
  	}
  	db.loadCorporaInformation();
  	db.shutdown();
  	
      WebAppContext context = new WebAppContext();
      context.setDescriptor("./server/WEB-INF/web.xml");
      context.setResourceBase("./server");
      context.setContextPath("/");
      context.setParentLoaderPriority(true);

      server.setHandler(context);
      server.setThreadPool(new QueuedThreadPool(500));

      server.start();
      server.join();
  }
 
開發者ID:arne-cl,項目名稱:fangorn,代碼行數:44,代碼來源:StartServer.java

示例9: HttpServer

import org.mortbay.jetty.webapp.WebAppContext; //導入方法依賴的package包/類
public HttpServer(String name, String bindAddress, int port,
    boolean findPort, Connector connector, Configuration conf,
    String[] pathSpecs) throws IOException {
  this.webServer = new Server();
  this.findPort = findPort;

  if (connector == null) {
    listenerStartedExternally = false;
    listener = createBaseListener(conf);
    listener.setHost(bindAddress);
    listener.setPort(port);

  } else {
    listenerStartedExternally = true;
    listener = connector;
  }
  webServer.addConnector(listener);

  SessionIdManager sessionIdManager = new HashSessionIdManager(new Random(System.currentTimeMillis()));
  webServer.setSessionIdManager(sessionIdManager);

  int maxThreads = conf.getInt("tajo.http.maxthreads", -1);
  // If HTTP_MAX_THREADS is not configured, QueueThreadPool() will use the
  // default value (currently 250).
  QueuedThreadPool threadPool = maxThreads == -1 ? new QueuedThreadPool()
      : new QueuedThreadPool(maxThreads);
  webServer.setThreadPool(threadPool);

  final String appDir = getWebAppsPath(name);
  ContextHandlerCollection contexts = new ContextHandlerCollection();

  webAppContext = new WebAppContext();
  webAppContext.setDisplayName(name);
  webAppContext.setContextPath("/");
  webAppContext.setResourceBase(appDir + "/" + name);
  webAppContext.setDescriptor(appDir + "/" + name + "/WEB-INF/web.xml");

  contexts.addHandler(webAppContext);
  webServer.setHandler(contexts);

  addDefaultApps(contexts, appDir, conf);
}
 
開發者ID:apache,項目名稱:tajo,代碼行數:43,代碼來源:HttpServer.java


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