开发者

Issue with multipart upload in servlet on seam

开发者 https://www.devze.com 2023-01-02 09:33 出处:网络
I created a servlet wich works fine when deployed in a separate war file, but I intend to use it as part of a seam application.

I created a servlet wich works fine when deployed in a separate war file, but I intend to use it as part of a seam application.

I use commons-fileupload but the iterator (see snippet) returns false (only when included in the seam-app).

Any ideas?

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

Additional Info: I don't want to use the technique described here since the uploading client is curl.

The HttpServle开发者_StackOverflow中文版tRequest is wrapped by org.jboss.seam.web.IdentityRequestWrapper Using the seam


I had to insert

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

into components.xml

Documentation

0

精彩评论

暂无评论...
验证码 换一张
取 消