简体   繁体   English

如何从一个tomcat中的servlet转发请求到另一个tomcat

[英]How to forward request from a servlet in one tomcat to other tomcat

Is it possible to forward the request from a servlet running to another servlet running in a different tomcat in the same machine? 是否可以将请求从运行中的servlet转发到在同一台机器上的不同Tomcat中运行的另一个servlet? I think its possible to configure this out in a cluster environment but not quite sure how to get this when two tomcat servers are not related in a cluster environment. 我认为有可能在群集环境中进行配置,但不确定在群集环境中两个不相关的tomcat服务器时如何获得此配置。 Please help. 请帮忙。

Yes. 是。 You can configure a load balancer to redirect the requests based on whatever rules you want. 您可以配置负载均衡器以根据所需的任何规则重定向请求。 Here is how to do it: http://tomcat.apache.org/tomcat-5.5-doc/balancer-howto.html#Comments 这是操作方法: http : //tomcat.apache.org/tomcat-5.5-doc/balancer-howto.html#Comments

If needed, you can configure each instance of tomcat to run on a different port. 如果需要,可以将每个tomcat实例配置为在不同的端口上运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM