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


Java ServletContextHandler.setInitParameter方法代码示例

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


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

示例1: main

import org.eclipse.jetty.servlet.ServletContextHandler; //导入方法依赖的package包/类
public static void main(String[] args) {
    int port = Configuration.INSTANCE.getInt("port", 8080);
    Server server = new Server(port);
    ServletContextHandler contextHandler
            = new ServletContextHandler(ServletContextHandler.SESSIONS);
    contextHandler.setContextPath("/");
    ServletHolder sh = new ServletHolder(new VaadinServlet());
    contextHandler.addServlet(sh, "/*");
    contextHandler.setInitParameter("ui", AnalysisUI.class.getCanonicalName());
    contextHandler.setInitParameter("productionMode", String.valueOf(PRODUCTION_MODE));
    server.setHandler(contextHandler);
    try {
        server.start();
        server.join();
    } catch (Exception e) {
        LOG.error("Failed to start application", e);
    }
}
 
开发者ID:tokenmill,项目名称:crawling-framework,代码行数:19,代码来源:Application.java

示例2: main

import org.eclipse.jetty.servlet.ServletContextHandler; //导入方法依赖的package包/类
public static void main(String[] args) {
    int port = Configuration.INSTANCE.getInt("port", 8080);
    Server server = new Server(port);
    ServletContextHandler contextHandler
            = new ServletContextHandler(ServletContextHandler.SESSIONS);
    contextHandler.setContextPath("/");
    ServletHolder sh = new ServletHolder(new VaadinServlet());
    contextHandler.addServlet(sh, "/*");
    contextHandler.setInitParameter("ui", CrawlerAdminUI.class.getCanonicalName());
    contextHandler.setInitParameter("productionMode", String.valueOf(PRODUCTION_MODE));
    server.setHandler(contextHandler);
    try {
        server.start();
        server.join();
    } catch (Exception e) {
        LOG.error("Failed to start application", e);
    }
}
 
开发者ID:tokenmill,项目名称:crawling-framework,代码行数:19,代码来源:Application.java

示例3: setWebSocketComponentServletInitialParameter

import org.eclipse.jetty.servlet.ServletContextHandler; //导入方法依赖的package包/类
protected void setWebSocketComponentServletInitialParameter(ServletContextHandler context, WebsocketEndpoint endpoint) {
    if (endpoint.getBufferSize() != null) {
        context.setInitParameter("bufferSize", endpoint.getBufferSize().toString());
    }
    if (endpoint.getMaxIdleTime() != null) {
        context.setInitParameter("maxIdleTime", endpoint.getMaxIdleTime().toString());
    }
    if (endpoint.getMaxTextMessageSize() != null) {
        context.setInitParameter("maxTextMessageSize", endpoint.getMaxTextMessageSize().toString());
    }
    if (endpoint.getMaxBinaryMessageSize() != null) {
        context.setInitParameter("maxBinaryMessageSize", endpoint.getMaxBinaryMessageSize().toString());
    }
    if (endpoint.getMinVersion() != null) {
        context.setInitParameter("minVersion", endpoint.getMinVersion().toString());
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:18,代码来源:WebsocketComponent.java

示例4: main

import org.eclipse.jetty.servlet.ServletContextHandler; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    Server server = new Server(8080);
    ServletContextHandler handler = new ServletContextHandler();
    handler.setContextPath("/");
    handler.setInitParameter("contextConfigLocation", "classpath*:spring-mvc.xml");
    ServletHolder servletHolder = new ServletHolder();
    servletHolder.setInitOrder(1);
    servletHolder.setHeldClass(DispatcherServlet.class);
    servletHolder.setInitParameter("contextConfigLocation", "classpath*:spring-mvc.xml");
    handler.addServlet(servletHolder, "/");
    server.setHandler(handler);
    server.start();
    server.join();
}
 
开发者ID:archerfeel,项目名称:awacs,代码行数:15,代码来源:WebappBoot.java

示例5: main

import org.eclipse.jetty.servlet.ServletContextHandler; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	new Thread(new Crawler()).start();// hourly
	JodelWebConfiguration conf;
	
	
	if (args.length != 1) {
		InputStream ins;
		File confFile = new File("conf/jodel.properties");
		if (confFile.exists()) {
			ins = new FileInputStream(confFile);
		} else {
			ins = Launcher.class.getResourceAsStream("jodel.properties");
		}
		conf = new JodelWebConfiguration(ins);
	} else {
		conf = new JodelWebConfiguration(new FileInputStream(new File(
				args[0])));
	}
	DatabaseConnection.init(conf);
	Server s = new Server(new InetSocketAddress(conf.getHostName(),
			conf.getPort()));
	((QueuedThreadPool) s.getThreadPool()).setMaxThreads(20);
	ServletContextHandler h = new ServletContextHandler(
			ServletContextHandler.SESSIONS);
	h.setInitParameter(SessionManager.__SessionCookieProperty, "Jodel-Session");
	h.addServlet(JodelWeb.class, "/*");
	HandlerList hl = new HandlerList();
	hl.setHandlers(new Handler[] { generateStaticContext(), h });
	s.setHandler(hl);
	s.start();
}
 
开发者ID:JodelTwitterBot,项目名称:JodelWeb,代码行数:32,代码来源:Launcher.java

示例6: main

import org.eclipse.jetty.servlet.ServletContextHandler; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	
	LiteWaveWebConfigurator conf;
	if (args.length != 1) {
		InputStream ins;
		File confFile = new File("conf/litewave.properties");

		ins = new FileInputStream(confFile);
		conf = new LiteWaveWebConfigurator(ins);
	} else {
		conf = new LiteWaveWebConfigurator(new FileInputStream(new File(
				args[0])));
	}
	

	DatabaseConnection.init(conf);
	
	Server s = new Server(new InetSocketAddress(conf.getHostName(),
			conf.getPort()));
	System.out.println("start Server");
	((QueuedThreadPool) s.getThreadPool()).setMaxThreads(20);
	ServletContextHandler h = new ServletContextHandler(
			ServletContextHandler.SESSIONS);
	h.setInitParameter(SessionManager.__SessionCookieProperty, "DB-Session");
	h.addServlet(LiteWaveMain.class, "/*");
	HandlerList hl = new HandlerList();
	hl.setHandlers(new Handler[] { generateStaticContext(), h });
	s.setHandler(hl);
	s.start();
	
	//For intel systems (OmniDriver Initialization
	/*
	
	ExecutorService executor = Executors.newSingleThreadExecutor();
	try {
		executor.submit(new InitSpectrometer()).get(1800, TimeUnit.SECONDS);
	} catch (InterruptedException | ExecutionException | TimeoutException e1) {
		System.out.println("Timeout: USB driver not Initialized");
		e1.printStackTrace();
	} // Timeout of 10 minutes.
	executor.shutdown(); */
	
}
 
开发者ID:LiteWaveLabs,项目名称:LiteWaveWeb,代码行数:44,代码来源:Launcher.java


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