当使用 jetty 嵌入时,即像这样注册一个 servlet:
ServletContextHandler context = new ServletContextHandler(server, "/", false, false);
s = new UploadServlet(jee);
context.addServlet(new ServletHolder(s), "/upload");
似乎不尊重 MultipartConfig 注释。如何在 Servlet 3.0 下注册支持文件上传的 URL?对 Jetty 代码进行逆向工程显示它一定是这样的,但是“multi”是什么???
ServletHolder sh = new ServletHolder(new UploadServlet(jee));
Object multi;
sh.getRegistration().setMultipartConfig(new MultipartConfigElement(multi));
context.addServlet(sh, "/upload");