code: protected Server configureJetty(final int port) {
          final Server server = new Server();
          final ServerConnector connector = new ServerConnector(server);
          final ServletContextHandler sch = getServletContextHandler();
  
          // TODO: make all of this configurable
          connector.setIdleTimeout((int)TimeUnit.HOURS.toMillis(1));
          connector.setSoLingerTime(-1);
          connector.setPort(port);
  
          server.addConnector(connector);
  
          // set the injector as an attribute in the context
          sch.setAttribute("guice-injector", getInjector());
  
          // prevent the JSESSIONID from getting set via a URL argument
          sch.setInitParameter("org.eclipse.jetty.servlet.SessionIdPathParameterName", "none");
  
          // if we're using a database, then install the filter
          if(!settings.getDatabaseSettings().getNotUsed()) {
              // setup a FilterHolder for the Guice Persistence
              final FilterHolder persistFilter = new FilterHolder(getInjector().getInstance(PersistFilter.class));
  
              // add the filter to the context
              sch.addFilter(persistFilter, "/*", DISPATCHER_TYPES);
          }
  
          // configure a FilterHolder for Guice
          final FilterHolder filterHolder = new FilterHolder(GuiceFilter.class);
  
          sch.addFilter(filterHolder, "/*", DISPATCHER_TYPES);
          sch.addServlet(DefaultServlet.class, "/*");
  
          //server.setDumpAfterStart(true);
          server.setHandler(sch);
  
  
          return server;
      }
docs: Function used to configure Jetty and return a Server instance.
  @param port the port to run Jetty on.
  @return the {@link Server} instance.