当前位置: 首页>>代码示例>>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;未经允许,请勿转载。