【发布时间】:2017-12-21 08:55:39
【问题描述】:
我用的是RESTEasy 3.1.4-Final,我有一个方法:
@GET
@Produces(MediaType.TEXT_HTML)
public Response getInteractionsData(@Context UriInfo ui) {
return Response.ok().entity("index.html").build();
}
如何重定向到 index.html?现在我得到一个纯文本“index.html”(带有响应标题文本/html)。 另见https://docs.oracle.com/cd/E19776-01/820-4867/ghrpv/
在我为此目标使用 Servlet API 之前:
RequestDispatcher dispatcher = request.getRequestDispatcher("index.html");
if (dispatcher != null) {
dispatcher.forward(request, response);
}
但现在我不能有 request 或 response。对不起我的英语不好
【问题讨论】:
标签: java html redirect resteasy