简体   繁体   English

requestdispatcher如何为休息服务工作

[英]How requestdispatcher will work for rest service

In servlet we can use requestdispatcher and it will forward from servlet to servlet or html file.but i tried this requestdispatcher in rest service.its not forwarding from service 1 to service 2.its just stop in service 1 not forwarding. 在servlet中,我们可以使用requestdispatcher,它将从servlet转发到servlet或html文件。但是我在rest service中尝试了这个requestdispatcher。它没有从服务1转发到服务2.它只是在服务1中停止而不转发。 i'm getting 404 error in client side.so how i can achieve this in rest service.following the code 我在client.so中收到404错误,因此我如何在rest service中实现此功能。

RequestDispatcher rd = request.getRequestDispatcher("/v1/status1/toreply1"); 
rd.forward(request, response);

anything wrong in my coding..?please correct me if i'm wrong 我的编码中有任何错误..?如果我错了,请纠正我

404表示网址“ / v1 / status1 / toreply1”存在问题,请确保它是正确的

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

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