简体   繁体   English

如何在JAX-RS中转发HTTP请求

[英]How to forward HTTP request in JAX-RS

What is the equivalent of requestDispatcher.forward in JAX-RS? 在JAX-RS中等效于requestDispatcher.forward

httpRequest.getRequestDispatcher("/WEB-INF/" + getViewType(httpRequest) + "/login.jsp").forward(httpRequest, servletResponse);

Actaully i want to make GET call to a JSP page from rest service developed using JAX-RS. 实际上,我想从使用JAX-RS开发的rest服务中对JSP页面进行GET调用。

You can use exactly the same code with JAX-RS. 您可以对JAX-RS使用完全相同的代码。 Use @Context HttpServletRequest to get the httpRequest . 使用@Context HttpServletRequest获取httpRequest

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

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