Java seam上servlet中的多部分上载问题
我创建了一个ServletWich,当部署在单独的war文件中时工作正常,但我打算将它用作seam应用程序的一部分 我使用commons fileupload,但迭代器(参见代码段)返回false(仅当seam应用程序中包含时) 有什么想法吗Java seam上servlet中的多部分上载问题,java,jboss,file-upload,seam,apache-commons,Java,Jboss,File Upload,Seam,Apache Commons,我创建了一个ServletWich,当部署在单独的war文件中时工作正常,但我打算将它用作seam应用程序的一部分 我使用commons fileupload,但迭代器(参见代码段)返回false(仅当seam应用程序中包含时) 有什么想法吗 protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { t
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
String action = request.getParameter( "action" );
if ( ServletFileUpload.isMultipartContent( request ) ) {
log.info( "MULTIPART" );
}
ServletFileUpload upload = new ServletFileUpload();
FileItemIterator iter = upload.getItemIterator( request );
// --------- hasNext() returns false, only in seam -----------
while ( iter.hasNext() ) {
......
}
其他信息:
我不想使用上面描述的技术,因为上传客户端是curl
HttpServletRequest
由org.jboss.seam.web.IdentityRequestWrapper
使用我不得不插入的seam来包装
<web:multipart-filter create-temp-files="true"
max-request-size="1000000"
url-pattern="*.seam"/>
进入components.xml