当前位置: 首页>>代码示例>>Java>>正文


Java WebAppContext.setLogUrlOnStart方法代码示例

本文整理汇总了Java中org.eclipse.jetty.webapp.WebAppContext.setLogUrlOnStart方法的典型用法代码示例。如果您正苦于以下问题:Java WebAppContext.setLogUrlOnStart方法的具体用法?Java WebAppContext.setLogUrlOnStart怎么用?Java WebAppContext.setLogUrlOnStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jetty.webapp.WebAppContext的用法示例。


在下文中一共展示了WebAppContext.setLogUrlOnStart方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildJetty

import org.eclipse.jetty.webapp.WebAppContext; //导入方法依赖的package包/类
public void buildJetty(int port, String sourceDir, String webXmlFile) throws Exception {
    server = new Server();

    SelectChannelConnector connector = new SelectChannelConnector();
    connector.setPort(port);
    server.addConnector(connector);
    WebAppContext context = new WebAppContext();
    context.setResourceBase(sourceDir);
    context.setDescriptor(sourceDir + "/WEB-INF/" + webXmlFile);
    context.setLogUrlOnStart(true);
    context.setContextPath("/");
    context.setParentLoaderPriority(true);

    server.setHandler(context);

    server.start();
}
 
开发者ID:hazelcast,项目名称:hazelcast-wm,代码行数:18,代码来源:JettyServer.java

示例2: configure

import org.eclipse.jetty.webapp.WebAppContext; //导入方法依赖的package包/类
@Override
public Server configure() throws Exception {
    Server server = new Server(port);

    WebAppContext context = new WebAppContext();
    context.setResourceBase("../jetty-core/src/test/resources/" + appName);
    context.setLogUrlOnStart(true);
    context.setContextPath("/");
    context.setParentLoaderPriority(true);

    HazelcastSessionIdManager idManager = new HazelcastSessionIdManager(server, clientOnly);
    idManager.setWorkerName("worker-" + port);
    server.setSessionIdManager(idManager);

    HazelcastSessionManager sessionManager = new HazelcastSessionManager();
    sessionManager.setSessionIdManager(idManager);

    SessionHandler handler = new SessionHandler(sessionManager);
    context.setSessionHandler(handler);

    server.setHandler(context);
    server.setStopTimeout(0);

    HashLoginService loginService = new HashLoginService();
    loginService.putUser("someuser", Credential.getCredential("somepass"), new String[]{"role1", "role2"});
    context.getSecurityHandler().setLoginService(loginService);

    return server;
}
 
开发者ID:hazelcast,项目名称:hazelcast-jetty-sessionmanager,代码行数:30,代码来源:JettyConfigurator.java

示例3: configure

import org.eclipse.jetty.webapp.WebAppContext; //导入方法依赖的package包/类
@Override
public Server configure() throws Exception {
    Server server = new Server(port);

    WebAppContext context = new WebAppContext();
    context.setResourceBase("../jetty-core/src/test/resources/" + appName);
    context.setLogUrlOnStart(true);
    context.setContextPath("/");
    context.setParentLoaderPriority(true);

    HazelcastSessionIdManager idManager = new HazelcastSessionIdManager(server, clientOnly);

    idManager.setWorkerName("worker-" + port);
    server.setSessionIdManager(idManager);

    HazelcastSessionManager sessionManager = new HazelcastSessionManager();
    sessionManager.setSessionIdManager(idManager);

    SessionHandler handler = new SessionHandler(sessionManager);
    context.setSessionHandler(handler);

    server.setHandler(context);
    server.setGracefulShutdown(0);

    HashLoginService loginService = new HashLoginService();
    loginService.putUser("someuser", Credential.getCredential("somepass"), new String[]{"role1", "role2"});
    context.getSecurityHandler().setLoginService(loginService);

    return server;
}
 
开发者ID:hazelcast,项目名称:hazelcast-jetty-sessionmanager,代码行数:31,代码来源:JettyConfigurator.java

示例4: setupWebapp

import org.eclipse.jetty.webapp.WebAppContext; //导入方法依赖的package包/类
/**
 * This method is called to setup the application, it prepares the
 * application context, defines your web.xml and override-web.xml etc ...
 * This is basically what makes your application behave as if it was
 * deployed in a full fledged standard container ...
 *
 * @return WebAppContext
 */
private static WebAppContext setupWebapp() {
    ProtectionDomain domain = JServer.class.getProtectionDomain();
    URL location = domain.getCodeSource().getLocation();
    WebAppContext webapp = new WebAppContext();
    webapp.setContextPath("/");
    webapp.setLogUrlOnStart(true);
    webapp.setParentLoaderPriority(true);
    webapp.setWar(location.toExternalForm());
    webapp.setDescriptor("WEB-INF/web.xml");
    webapp.setOverrideDescriptor("WEB-INF/override-web.xml");
    webapp.prependServerClass("-org.eclipse.jetty.servlet.,-org.eclipse.jetty.server."); //TODO: too much exposure, check which classes are needed.
    webapp.setServer(embed_server);
    return webapp;
}
 
开发者ID:korena,项目名称:service-base,代码行数:23,代码来源:JServer.java


注:本文中的org.eclipse.jetty.webapp.WebAppContext.setLogUrlOnStart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。