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