Java RESTEasy支持隧道吗?
正如Restlet文档中提到的,它有一个名为的特性。RESTEasy中也存在此功能吗?下面的Servlet通过从请求中委托方法参数来支持隧道Java RESTEasy支持隧道吗?,java,jax-rs,resteasy,Java,Jax Rs,Resteasy,正如Restlet文档中提到的,它有一个名为的特性。RESTEasy中也存在此功能吗?下面的Servlet通过从请求中委托方法参数来支持隧道 import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.jboss.
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher;
public class TunnelingDispatcher extends HttpServletDispatcher {
@Override
protected void service(HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) throws ServletException,
IOException {
String method = httpServletRequest.getParameter("method");
if (method == null) {
method = httpServletRequest.getMethod();
} else {
method = method.toUpperCase();
}
service(method, httpServletRequest, httpServletResponse);
}
}