【问题标题】:Bind connector to handler将连接器绑定到处理程序
【发布时间】:2016-12-02 14:35:23
【问题描述】:

如何在 Jetty 服务器中将Connector 绑定到Handler

  1. 处理程序 A -> url 映射 /first -> 为端口 8282 打开连接器
  2. 处理程序 B -> url 映射 /second-> 为端口 9292 打开连接器

所以我可以得到这样的结果:

localhost:8282/first -> 处理程序 A 将处理它

localhost:9292/second -> 处理程序 B 将处理它

localhost:8282/second -> 错误 404

localhost:9292/first -> 错误 404

现在,如果我为 Jetty 添加额外的 Connector,我可以从任何端口访问 /first 或 /second。

【问题讨论】:

    标签: jetty embedded-jetty


    【解决方案1】:

    为连接器提供一个name,并在您的处理程序的VirtualHost 配置中使用该@name

    查看之前的答案(以及其中的示例)。

    https://stackoverflow.com/a/26149232/775715

    【讨论】:

      猜你喜欢
      • 2010-11-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-05
      • 2018-10-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多