【发布时间】:2016-12-02 14:35:23
【问题描述】:
如何在 Jetty 服务器中将Connector 绑定到Handler?
- 处理程序 A -> url 映射 /first -> 为端口 8282 打开连接器
- 处理程序 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