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