【问题标题】:Issue with multipart upload in servlet on seam在seam上的servlet中分段上传的问题
【发布时间】:2011-02-26 10:52:53
【问题描述】:

我创建了一个 servlet,它在部署在单独的 war 文件中时可以正常工作,但我打算将它用作 seam 应用程序的一部分。

我使用 commons-fileupload 但迭代器(参见 sn-p)返回 false(仅当包含在 seam-app 中时)。

有什么想法吗?

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() ) {
                             ......
                    }

附加信息: 我不想使用here 描述的技术,因为上传客户端是 curl。

HttpServletRequestorg.jboss.seam.web.IdentityRequestWrapper 包裹起来使用接缝

【问题讨论】:

    标签: java jboss file-upload seam apache-commons


    【解决方案1】:

    我必须插入

    <web:multipart-filter create-temp-files="true" 
            max-request-size="1000000" 
            url-pattern="*.seam"/>
    

    转入components.xml

    Documentation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-17
      • 1970-01-01
      • 2019-10-22
      • 2020-08-03
      • 2011-08-20
      • 1970-01-01
      相关资源
      最近更新 更多