开发者

how can a servlet in one jvm communicate with servlet in another jvm

开发者 https://www.devze.com 2022-12-25 10:48 出处:网络
can this be solved s开发者_如何学运维imply by specifying the complete url of the servlet in the RequestDispatcher?If the two servlets are deployed completely separately, then the simplest means of com

can this be solved s开发者_如何学运维imply by specifying the complete url of the servlet in the RequestDispatcher?


If the two servlets are deployed completely separately, then the simplest means of communication is via HTTP and specifying the URL (after all, that is the API they are presenting).

Using a library such as HttpClient will simplify this process and manage sessions/authentication etc. if/when required.


Brian is true, use HttpClient to do that.

But anyway it seems to be a poor design to call a servlet from another servlet no? You'd better make at least a service that will handle the request to the other servlet.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号