views:

98

answers:

1

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 HttpServletRequest is wrapped by org.jboss.seam.web.IdentityRequestWrapper Using the seam

+2  A: 

I had to insert

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

into components.xml

Documentation

stacker
@stacker Good (+1) Do not forget mark it as accepted Two days from now
Arthur Ronald F D Garcia