如何在spring-boot中轻松配置Jetty? [英] How to configure Jetty in spring-boot (easily?)

查看:603
本文介绍了如何在spring-boot中轻松配置Jetty?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过学习本教程,我可以使用以下依赖项启动Jetty的spring-boot.

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>

但是,如何配置Jetty服务器,例如:

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

  1. 服务器线程(队列线程池)
  2. 服务器连接器
  3. Https配置.
  4. Jetty中所有可用的配置...?

有一种简便的方法

  1. application.yml?
  2. 配置类?

任何例子都将不胜感激.

Any example would be greatly appreciated.

非常感谢!

推荐答案

对于servlet容器,有一些常规扩展点,还有一些将Jetty API调用插入其中的选项,因此,我认为可以满足您的所有需求.可以找到一般建议 . Jetty还没有引起足够的重视,因此声明式配置可能没有与Tomcat相同的选项,并且可以肯定的是它不会被使用太多.如果您想帮助改变这一点,欢迎提供帮助.

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.

这篇关于如何在spring-boot中轻松配置Jetty?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆