如何从multipart / mixed请求中获取所有多部分文件?

时间:2016-05-24 19:16:16

标签: java spring spring-mvc multipart

我试图从multipart / mixed请求中获取json String和其他部分。这是我的类控制器中的方法:

@RequestMapping(value = {"", "/"}, method = RequestMethod.POST, produces = "application/json;charset=utf-8")
public void postStatement(@RequestPart String json,@RequestPart MultipartFile parts) {
  //...proccesing data
}

这是我的要求:

Content-Type: multipart/mixed; boundary=abcABC0123'()+_,-./:=?
X-Experience-API-Version:1.0.0


--abcABC0123'()+_,-./:=?
Content-Type:application/json

{
    "x": {
        "a": "value1",
        "b": "value2",
        "c": "value3"
    }
}
--abcABC0123'()+_,-./:=?
Content-Type:text/plain
Content-Transfer-Encoding:binary

here is a simple attachment
--abcABC0123'()+_,-./:=?--

但是我收到以下错误:

org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly

at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:165)

at org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:142)

at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1067)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:906)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)

at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1120)

at com.grammata.lrs.application.CORSFilter.doFilterInternal(CORSFilter.java:27)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1111)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1111)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)

at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:219)

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:786)

at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:431)

at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)

at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:113)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

at org.mortbay.jetty.Server.handle(Server.java:325)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:533)

at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:870)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:657)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:391)

at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:421)

at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:497)

引起:org.apache.commons.fileupload.FileUploadException:Stream意外终止

at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:362)

at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115)

at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:158)

... 49 more

引起:org.apache.commons.fileupload.MultipartStream $ MalformedStreamException:流意外结束

at org.apache.commons.fileupload.MultipartStream.readHeaders(MultipartStream.java:540)

at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:1038)

at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:1003)

at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:310)

at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:334)

... 51 more

引起:

org.apache.commons.fileupload.FileUploadException: Stream ended unexpectedly

at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:362)

at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115)

at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:158)

at org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:142)

at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1067)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:906)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)

at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1120)

at com.grammata.lrs.application.CORSFilter.doFilterInternal(CORSFilter.java:27)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1111)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1111)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)

at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:219)

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:786)

at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:431)

at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)

at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:113)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

at org.mortbay.jetty.Server.handle(Server.java:325)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:533)

at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:870)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:657)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:391)

at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:421)

at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:497)

Caused by: org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly

at org.apache.commons.fileupload.MultipartStream.readHeaders(MultipartStream.java:540)

at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:1038)

at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:1003)

at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:310)

at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:334)

... 51 more

Caused by:

org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly

at org.apache.commons.fileupload.MultipartStream.readHeaders(MultipartStream.java:540)

at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:1038)

at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:1003)

at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:310)

at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:334)

at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115)

at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:158)

at org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:142)

at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1067)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:906)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)

at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1120)

at com.grammata.lrs.application.CORSFilter.doFilterInternal(CORSFilter.java:27)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1111)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1111)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)

at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:219)

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:786)

at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:431)

at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)

at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:113)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

at org.mortbay.jetty.Server.handle(Server.java:325)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:533)

at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:870)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:657)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:391)

at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:421)

at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:497)

引起:

at org.apache.commons.fileupload.MultipartStream.readHeaders(MultipartStream.java:540)

at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:1038)

at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:1003)

at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:310)

at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:334)

at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115)

at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:158)

at org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:142)

at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1067)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:906)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)

at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1120)

at com.grammata.lrs.application.CORSFilter.doFilterInternal(CORSFilter.java:27)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1111)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)

at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)

at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)

at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)

at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)

at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)

at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1111)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)

at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:219)

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:786)

at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:431)

at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)

at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:113)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

at org.mortbay.jetty.Server.handle(Server.java:325)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:533)

at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:870)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:657)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:391)

at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:421)

at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:497)

我的目标是获取一个json对象,然后是几个可以是图像,图纸文本等的文件。我怎么能这样做?

1 个答案:

答案 0 :(得分:0)

代码不包含错误。问题是我错误地使用了客户端休息mozilla插件,但是我用curl改了它,一切正常