本文整理汇总了Java中org.eclipse.jetty.servlet.ServletContextHandler.setMaxFormContentSize方法的典型用法代码示例。如果您正苦于以下问题:Java ServletContextHandler.setMaxFormContentSize方法的具体用法?Java ServletContextHandler.setMaxFormContentSize怎么用?Java ServletContextHandler.setMaxFormContentSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jetty.servlet.ServletContextHandler
的用法示例。
在下文中一共展示了ServletContextHandler.setMaxFormContentSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startServer
import org.eclipse.jetty.servlet.ServletContextHandler; //导入方法依赖的package包/类
private void startServer() throws Exception {
log.info("Starting http server on port " + httpPort);
Server server = new Server(new QueuedThreadPool(threadCount));
ServerConnector serverConnector = new ServerConnector(server);
serverConnector.setPort(httpPort);
if (!Strings.isNullOrEmpty(httpBindAddress)) {
serverConnector.setHost(httpBindAddress);
}
server.setConnectors(new Connector[]{serverConnector});
ServletContextHandler context = new ServletContextHandler();
context.setMaxFormContentSize(maxFormContextSizeBytes);
context.setContextPath("/");
ServletHolder metricSearchServletHolder = new ServletHolder(metricSearchServlet);
context.addServlet(metricSearchServletHolder, "/search/*");
context.addServlet(metricSearchServletHolder, "/ban/*");
context.addServlet(metricSearchServletHolder, "/multiBan/*");
context.addServlet(metricSearchServletHolder, "/approve/*");
context.addServlet(metricSearchServletHolder, "/multiApprove/*");
context.addServlet(metricSearchServletHolder, "/hide/*");
context.addServlet(metricSearchServletHolder, "/multiHide/*");
ServletHolder monitoringServletHolder = new ServletHolder(monitoringServlet);
context.addServlet(monitoringServletHolder, "/ping");
context.addServlet(monitoringServletHolder, "/monitoring");
ServletHolder metricDataServletHolder = new ServletHolder(metricDataServiceServlet);
context.addServlet(metricDataServletHolder, "/metricData");
HandlerCollection handlers = new HandlerCollection();
handlers.setHandlers(new Handler[]{context, new DefaultHandler()});
server.setHandler(handlers);
server.start();
log.info("Web server started on port " + httpPort);
}