Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/352.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java RESTEasy支持隧道吗?_Java_Jax Rs_Resteasy - Fatal编程技术网

Java RESTEasy支持隧道吗?

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.

正如Restlet文档中提到的,它有一个名为的特性。RESTEasy中也存在此功能吗?

下面的Servlet通过从请求中委托方法参数来支持隧道

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);
}

}