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
精彩评论