Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.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 将Spring Dispatcher Servlet路径转换为ZuulServlet_Java_Spring_Spring Boot_Netflix Zuul - Fatal编程技术网

Java 将Spring Dispatcher Servlet路径转换为ZuulServlet

Java 将Spring Dispatcher Servlet路径转换为ZuulServlet,java,spring,spring-boot,netflix-zuul,Java,Spring,Spring Boot,Netflix Zuul,使用Zuul代理上载大文件时- 为了绕过Spring DispatcherServlet,我更改了URL: 发件人: 致: 保留禁用Spring多部分上载: spring: http: multipart: enabled: false 但是我不想对我的客户端URI(host/MyService/**)使用任何额外的前缀(/zuul/),所以在我的预筛选中,我检查原始请求是否是多部分形式的 如果请求是多部分形式的,我将尝试将请求URI更新为hos

使用Zuul代理上载大文件时- 为了绕过Spring DispatcherServlet,我更改了URL: 发件人: 致:

保留禁用Spring多部分上载:

spring:
    http:
        multipart:
            enabled: false
但是我不想对我的客户端URI(host/MyService/**)使用任何额外的前缀(/zuul/),所以在我的预筛选中,我检查原始请求是否是多部分形式的

如果请求是多部分形式的,我将尝试将请求URI更新为host/zuul/MyService。我还想将布尔值isDispatcherServletRequest设置为false

这是我的预滤器-

@Override
    public Object run() throws ZuulException {



        RequestContext ctx = RequestContext.getCurrentContext();
        HttpServletRequest request = ctx.getRequest();
        System.out.println("Request type of content type "+request.getContentType());
        String requestType = request.getContentType();
        if(requestType.contains("multipart/form-data")) {

            String originalRequestPath = request.getRequestURI();
            String modifiedRequestPath = "/zuul" + originalRequestPath;
            ctx.put("REQUEST_URI_KEY", modifiedRequestPath);



        }
        return null;
    }
问题1:如何将新URI放入requestContext

问题2:如何在筛选器中禁用DispatcherServletRequest