在泽西岛,我想向另一个网站转播。 我如何能够做到这一点?
@Path("/")
public class News {
@GET
@Produces(MediaType.TEXT_HTML)
@Path("go/{news_id}")
public String getForwardNews(
@PathParam("news_id") String id) throws Exception {
//how can I make here a forward to "http://somesite.com/news/id" (not redirect)?
return "";
}
}
http://www.un.org。
页: 1 替代类别(Proxy78/code)的本地价值 在试图做这样的事情时有错误:
@Context
HttpServletRequest request;
@Context
HttpServletResponse response;
@Context
ServletContext context;
...
RequestDispatcher dispatcher = context.getRequestDispatcher("url");
dispatcher.forward(request, response);