當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。