How to configure Jetty in spring-boot (easily?)

By following the tutorial, I could bring up the spring-boot with Jetty running using the following dependencies.

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jetty</artifactId>
    </dependency>

However, how could I configure the Jetty server such as:

  1. Server threads (Queue thread pool)
  2. Server connectors
  3. Https configurations.
  4. all those configuration available in Jetty…?

Is there an easy way to do in

  1. application.yml?
  2. Configuration class?

Any example would be greatly appreciated.

Many thanks!!

Programmatically configure Jetty’s logger

How do I programmatically configure Jetty’s logger? I’m using Jetty in a standalone application and want to change the log level of some of Jetty’s internally generated warnings. Ideally I could do th

Configure SSL on Jetty

I am trying to configure SSL on my Jetty. I read this: http://docs.codehaus.org/display/JETTY/How+to+configure+SSL and created a key store. Then, I jumped directly to section 4. But where is this conf

how to configure jetty to use log4j?

How do I configure jetty to use use log4j? I’m already using log4j in my application, while jetty logs to stderr… import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import

How to configure embedded jetty to access Jersey resources?

I’m trying to configure embedded jetty to talk to my Jersey resources but I can’t figure out how to do it. I’ve tried a couple of different things but nothing seems to work. The jetty tutorials don’t

Configure embedded Jetty in Hadoop

There’s an embedded Jetty in Hadoop. I wish to add a new web application to – for example – localhost:50077, where my custom JSP would run. How and where can I configure the embedded Jetty in Hadoop t

Jetty, Maven plugin – how to configure default document?

We’re using Jetty 6.x, and Maven-2. Anybody knows how to configure the default document? I mean – there’s a default that serves /index.html or any of it’s equivalents when accessing the application ro

How do you configure jetty to allow access from an external server?

I’ve seen this asked before, with no good answers, how do you configure jetty to allow access from an external server? I’ve just started messing around with solr and jetty and am using the example jet

How do i configure Railo on Jelastic (PAAS) to work with multiple domains using Jetty?

How do i configure Railo on Jelastic (PAAS) to work with multiple domains using Jetty? I found the configuration for Railo using Tomcat, but I would like to use Jetty because of the memory requirement

how to configure jetty to listen to multiple ports [closed]

I just want to configure jetty to listen to more than one port. I don’t want multiple instances nor multiple webapps, just one jetty, one webapp, but listening to 2 or more ports. The default way does

How to configure Jetty 9 CGI on Windows 7?

readI’m trying to configure CGI (for perl scripts) on Jetty 9.1.5.v20140505, Windows 7. When trying solutions from the inet always getting errors that those functions/methods wouldn’t be exist. Exampl

Answers

There are some general extension points for servlet containers and also options for plugging Jetty API calls into those, so I assume everything you would want is in reach. General advice can be found in the docs. Jetty hasn’t received as much attention yet so there may not be the same options available for declarative configuration as with Tomcat, and for sure it won’t have been used much yet. If you would like to help change that, then help is welcome.

Possibility to configure Jetty (in parts) programatically from http://howtodoinjava.com/spring/spring-boot/configure-jetty-server/

@Bean
public JettyEmbeddedServletContainerFactory  jettyEmbeddedServletContainerFactory() {
    JettyEmbeddedServletContainerFactory jettyContainer = 
        new JettyEmbeddedServletContainerFactory();

    jettyContainer.setPort(9000);
    jettyContainer.setContextPath("/home");
    return jettyContainer;
}